Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #4: Add Github Actions to run tests #7

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: test

on: workflow_dispatch
on: [push]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cancel runs for other PRs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this section just makes sure that if someone is pushing several commits to the same branch/PR then it will cancel the one that's already in-progress and run just the latest one. I think it's useful if someone is developing on a specific PR for example and they push 3 commits in 2 minutes then it will make sure that only the latest job will be run to completion. do you think it's better to take it out?


env:
FOUNDRY_PROFILE: ci
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we do the env stuff here rather than creating a file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed

Expand Down Expand Up @@ -28,6 +32,17 @@ jobs:
forge build --sizes
id: build

- name: Create env file
run: |
touch .env
echo OP_MAINNET_RPC="${{ secrets.OP_MAINNET_RPC }}" >> .env
echo OP_GOERLI_RPC="${{ secrets.OP_GOERLI_RPC }}" >> .env
echo OP_MAINNET_DEPLOYER_PK="${{ secrets.TEST_DEPLOYER_PK }}" >> .env
echo OP_GOERLI_DEPLOYER_PK="${{ secrets.TEST_DEPLOYER_PK }}" >> .env
echo ARB_GOERLI_RPC="${{ secrets.ARB_GOERLI_RPC }}" >> .env
echo ARB_MAINNET_RPC="${{ secrets.ARB_MAINNET_RPC }}" >> .env
cat .env
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe remove the cat, since we dont need to display the env

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the cat command and moved this entire "create .env" job into the env category that we had already. It runs successfully:

https://github.com/open-dollar/od-relayer/actions/runs/7213145447/job/19652349583


- name: Run Forge tests
run: |
forge test -vvv
Expand Down
Loading