-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Consolidate the github setup action #6239
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
Merged
+102
−41
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
207b7cc
Refactor setup action to include java, python and solc
Amxx 8cacada
Update .github/actions/setup/action.yml
Amxx 0425110
Update action.yml
Amxx ba72557
Update .github/actions/setup/action.yml
Amxx 81cfd7b
Apply suggestions from code review
Amxx 9bcfe3f
Update .github/actions/setup/action.yml
Amxx 457a7ec
Merge branch 'master' into CI/update-setup-action
Amxx ec48966
up
Amxx abbc7d2
allow overriding version
Amxx 935605c
change case
Amxx 9e29c0f
update version selection
Amxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,77 @@ | ||
| name: Setup | ||
| description: Common environment setup | ||
| inputs: | ||
| withNpm: | ||
| description: Whether to set up Node.js and npm | ||
| required: false | ||
| default: 'true' | ||
| withFoundry: | ||
| description: Whether to set up Foundry | ||
| required: false | ||
| default: 'true' | ||
| withJava: | ||
| description: Whether to set up Java | ||
| required: false | ||
| default: 'false' | ||
| withPython: | ||
| description: Whether to set up Python | ||
| required: false | ||
| default: 'false' | ||
| withSolc: | ||
| description: Whether to set up solc | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: actions/setup-node@v6 | ||
| # Node & npm setup | ||
| - name: Install Node.js (24.x) | ||
| if: ${{ inputs.withNpm == 'true' }} | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 24.x | ||
| - uses: actions/cache@v5 | ||
| - name: Cache node modules | ||
| id: cache | ||
| if: ${{ inputs.withNpm == 'true' }} | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: '**/node_modules' | ||
| key: npm-v3-${{ hashFiles('**/package-lock.json') }} | ||
Amxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| if: ${{ inputs.withNpm == 'true' && steps.cache.outputs.cache-hit != 'true' }} | ||
| shell: bash | ||
| if: steps.cache.outputs.cache-hit != 'true' | ||
| - name: Install Foundry | ||
| run: npm ci | ||
| # Foundry setup | ||
| - name: Install Foundry (stable) | ||
| if: ${{ inputs.withFoundry == 'true' }} | ||
| uses: foundry-rs/foundry-toolchain@v1 | ||
| with: | ||
| version: stable | ||
| # Java setup | ||
| - name: Install java 21 | ||
| if: ${{ inputs.withJava == 'true' }} | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 21 | ||
| # Python setup | ||
| - name: Install python (3.13) | ||
| if: ${{ inputs.withPython == 'true' }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.13 | ||
| cache: 'pip' | ||
| cache-dependency-path: 'fv-requirements.txt' | ||
| - name: Install python packages | ||
| if: ${{ inputs.withPython == 'true' }} | ||
| shell: bash | ||
| run: pip install -r fv-requirements.txt | ||
| # Solc setup | ||
| - name: Install solc (0.8.31) | ||
| if: ${{ inputs.withSolc == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| wget https://github.com/ethereum/solidity/releases/download/v0.8.31/solc-static-linux | ||
| sudo mv solc-static-linux /usr/local/bin/solc | ||
| chmod +x /usr/local/bin/solc | ||
Amxx marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.