-
Notifications
You must be signed in to change notification settings - Fork 3
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, fixed |
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe remove the cat, since we dont need to display the env There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?