v3 upgrade scripts #3000
Workflow file for this run
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: Tests and Checks | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| env: | |
| FOUNDRY_PROFILE: ci | |
| TERM: ansi | |
| permissions: | |
| security-events: write | |
| jobs: | |
| security: | |
| uses: lidofinance/linters/.github/workflows/security.yml@master | |
| actions: | |
| uses: lidofinance/linters/.github/workflows/actions.yml@master | |
| # Maybe to make it reusable workflow instead? | |
| bootstrap: | |
| name: Bootstrap environment | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cache-path: ${{ steps.cache.outputs.path }} | |
| cache-key: ${{ steps.cache.outputs.key }} | |
| env: | |
| JUST_TAG: 1.24.0 | |
| steps: | |
| - name: Build cache params | |
| id: cache | |
| run: | | |
| echo "path=$CACHE_PATH" >> "$GITHUB_OUTPUT" | |
| echo "$KEY_INPUT" | md5sum | awk '{print $1}' | xargs -I% echo "key=cargobin-%-${RUNNER_OS}" >> "$GITHUB_OUTPUT" | |
| env: | |
| CACHE_PATH: | | |
| ~/.cargo/bin/ | |
| KEY_INPUT: | | |
| just:${{env.JUST_TAG}} | |
| - uses: actions/cache@v4 | |
| id: get-cache | |
| with: | |
| path: ${{ steps.cache.outputs.path }} | |
| key: ${{ steps.cache.outputs.key }} | |
| - name: Install just | |
| run: cargo install "just@$JUST_TAG" | |
| if: steps.get-cache.outputs.cache-hit != 'true' | |
| linters: | |
| name: Linters | |
| runs-on: ubuntu-latest | |
| needs: bootstrap | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set FOUNDRY_VERSION | |
| run: echo "FOUNDRY_VERSION=$(head .foundryref)" >> "$GITHUB_ENV" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ needs.bootstrap.outputs.cache-path }} | |
| key: ${{ needs.bootstrap.outputs.cache-key }} | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: ${{ env.FOUNDRY_VERSION }} | |
| - name: Install node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: yarn | |
| cache-dependency-path: "**/yarn.lock" | |
| - name: Install dependencies | |
| run: just deps-dev | |
| - name: Linters check | |
| run: just lint | |
| foundry: | |
| name: Foundry project | |
| runs-on: ubuntu-latest | |
| needs: bootstrap | |
| # env: | |
| # DISABLE_CODE_SIZE_LIMIT: 1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Set FOUNDRY_VERSION | |
| run: echo "FOUNDRY_VERSION=$(head .foundryref)" >> "$GITHUB_ENV" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ${{ needs.bootstrap.outputs.cache-path }} | |
| key: ${{ needs.bootstrap.outputs.cache-key }} | |
| - name: Install Foundry | |
| uses: foundry-rs/foundry-toolchain@v1 | |
| with: | |
| version: ${{ env.FOUNDRY_VERSION }} | |
| - name: Install node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: yarn | |
| cache-dependency-path: "**/yarn.lock" | |
| - name: Install dependencies | |
| run: just deps | |
| - name: Build | |
| run: just build --sizes | |
| # continue-on-error: true | |
| - name: Run unit-tests | |
| run: just test-unit | |
| - name: Run tests for current state on fork | |
| run: just test-current | |
| env: | |
| CHAIN: mainnet | |
| RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| - name: Run local deployment tests for scratch deploy | |
| run: just test-full-deploy | |
| env: | |
| CHAIN: mainnet | |
| RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| # TODO: Remake as v3-only and enable when new tests are ready | |
| # - name: Run local deployment tests for v2 deploy | |
| # run: just test-v2-only-deploy | |
| # env: | |
| # CHAIN: mainnet | |
| # RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| - name: Run local integration tests | |
| run: just test-local | |
| env: | |
| CHAIN: mainnet | |
| RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| - name: Run local integration tests for Curated Deployment | |
| run: just test-curated-local | |
| env: | |
| CHAIN: mainnet | |
| RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| # TODO: Enable when new upgrade tests are ready | |
| # - name: Run post-vote tests after upgrade | |
| # run: just test-upgrade --no-match-contract=VoteChangesTest | |
| # env: | |
| # CHAIN: mainnet | |
| # DEPLOY_CONFIG: ./artifacts/mainnet/deploy-mainnet.json | |
| # RPC_URL: ${{ secrets.RPC_URL_MAINNET }} | |
| # TODO: Enable later | |
| # - name: Check gas report | |
| # run: just gas-report && git diff --exit-code GAS.md | |
| # env: | |
| # RPC_URL: ${{ secrets.RPC_URL }} |