docs: make Lit Action examples standalone (#420) #61
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
| name: Contract Tests | |
| on: | |
| push: | |
| branches: [main, next] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| forge-test: | |
| if: > | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| name: forge-test | |
| runs-on: self-hosted | |
| concurrency: | |
| group: foundry-toolchain | |
| cancel-in-progress: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Reset workspace to HEAD | |
| run: git checkout HEAD -- . | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install contract dependencies | |
| working-directory: lit-api-server/blockchain/lit_node_express | |
| run: npm ci | |
| - name: Check Foundry toolchain | |
| id: foundry-toolchain | |
| run: | | |
| if command -v forge >/dev/null 2>&1 && forge --version | grep -Eq '(^|[^0-9])1\.5\.1([^0-9]|$)'; then | |
| forge --version | |
| echo "installed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "installed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Install Foundry | |
| if: steps.foundry-toolchain.outputs.installed != 'true' | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| # Pinned for reproducibility. Bump intentionally when upgrading. | |
| version: v1.5.1 | |
| - name: Build contracts | |
| working-directory: lit-api-server/blockchain/lit_node_express | |
| run: forge build --sizes | |
| - name: Run forge tests | |
| working-directory: lit-api-server/blockchain/lit_node_express | |
| run: forge test -vv |