From 9aab5cd38cd3b3ccb2cacd4d3e9cfe2bab1c5cec Mon Sep 17 00:00:00 2001 From: Kris <605420+krzysu@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:17:26 +0100 Subject: [PATCH] chore: update CI actions (#7385) --- .github/workflows/black_box_tests.yml | 96 ++++++++++++------------- .github/workflows/build.yml | 6 +- .github/workflows/canary_release.yml | 37 +++++----- .github/workflows/deploy-docs.yaml | 8 +-- .github/workflows/e2e_network_tests.yml | 90 +++++++++++------------ .github/workflows/stale.yml | 32 ++++----- 6 files changed, 134 insertions(+), 135 deletions(-) diff --git a/.github/workflows/black_box_tests.yml b/.github/workflows/black_box_tests.yml index 8d26e163264..bb47ea822d2 100644 --- a/.github/workflows/black_box_tests.yml +++ b/.github/workflows/black_box_tests.yml @@ -1,53 +1,53 @@ name: 'Black Box Tests' on: push: - branches: - - release/** - tags: - - v4.* + branches: + - release/** + tags: + - v4.* jobs: - build: - strategy: - matrix: - node: [18] - name: Build Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - run: yarn - - run: tar -czf /tmp/web3-${{ matrix.node }}.js.tar.gz --exclude="./.git" ./ - - uses: actions/upload-artifact@v3 - with: - name: web3-${{ matrix.node }}.js.tar.gz - path: /tmp/web3-${{ matrix.node }}.js.tar.gz - black-box: - name: Black Box - needs: build - runs-on: ubuntu-latest - env: - INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }} - INFURA_MAINNET_WS: ${{ secrets.INFURA_MAINNET_WS }} - INFURA_SEPOLIA_WS: ${{ secrets.INFURA_SEPOLIA_WS }} - MODE: ${{ matrix.mode }} - strategy: - fail-fast: false - matrix: - node: [18] - mode: ['http', 'ws'] - backend: ['geth', 'infura'] - steps: - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - uses: actions/download-artifact@v3 - with: - name: web3-${{ matrix.node }}.js.tar.gz - path: /tmp - - run: tar -xf /tmp/web3-${{ matrix.node }}.js.tar.gz -C ./ - - run: | - yarn test:blackbox:${{ matrix.backend }}:${{ matrix.mode }} - shell: bash + build: + strategy: + matrix: + node: [18] + name: Build Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - run: yarn + - run: tar -czf /tmp/web3-${{ matrix.node }}.js.tar.gz --exclude="./.git" ./ + - uses: actions/upload-artifact@v4 + with: + name: web3-${{ matrix.node }}.js.tar.gz + path: /tmp/web3-${{ matrix.node }}.js.tar.gz + black-box: + name: Black Box + needs: build + runs-on: ubuntu-latest + env: + INFURA_MAINNET_HTTP: ${{ secrets.INFURA_MAINNET_HTTP }} + INFURA_MAINNET_WS: ${{ secrets.INFURA_MAINNET_WS }} + INFURA_SEPOLIA_WS: ${{ secrets.INFURA_SEPOLIA_WS }} + MODE: ${{ matrix.mode }} + strategy: + fail-fast: false + matrix: + node: [18] + mode: ['http', 'ws'] + backend: ['geth', 'infura'] + steps: + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - uses: actions/download-artifact@v4 + with: + name: web3-${{ matrix.node }}.js.tar.gz + path: /tmp + - run: tar -xf /tmp/web3-${{ matrix.node }}.js.tar.gz -C ./ + - run: | + yarn test:blackbox:${{ matrix.backend }}:${{ matrix.mode }} + shell: bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81ce725b842..a9d9346359e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: - run: yarn test:unit continue-on-error: ${{ matrix.node == '20.17.0' }} - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: flags: UnitTests token: ${{ secrets.CODECOV_TOKEN }} @@ -162,7 +162,7 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 - uses: actions/cache/restore@v4 @@ -204,7 +204,7 @@ jobs: matrix: browser: ['electron', 'chrome', 'firefox'] steps: - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 18 - uses: browser-actions/setup-firefox@latest diff --git a/.github/workflows/canary_release.yml b/.github/workflows/canary_release.yml index f7081481f8d..8b59ebde563 100644 --- a/.github/workflows/canary_release.yml +++ b/.github/workflows/canary_release.yml @@ -1,23 +1,22 @@ name: 'Release Canary' on: - push: - branches: - - '4.x' + push: + branches: + - '4.x' jobs: - release: - name: release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - registry-url: 'https://registry.npmjs.org' - - run: yarn install --frozen-lockfile - - run: yarn build:web - - run: yarn publish:canary - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - \ No newline at end of file + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + registry-url: 'https://registry.npmjs.org' + - run: yarn install --frozen-lockfile + - run: yarn build:web + - run: yarn publish:canary + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index ce0ee35cee2..aff3ca793bb 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -1,10 +1,10 @@ name: Docs CloudFlare Deploy on: push: - branches: - - "4.x" - tags-ignore: - - v4* + branches: + - '4.x' + tags-ignore: + - v4* jobs: deploy: diff --git a/.github/workflows/e2e_network_tests.yml b/.github/workflows/e2e_network_tests.yml index 232420fca12..133815e4e2e 100644 --- a/.github/workflows/e2e_network_tests.yml +++ b/.github/workflows/e2e_network_tests.yml @@ -1,10 +1,10 @@ name: 'E2E Network Tests' on: push: - branches: - - release/** - tags: - - v4.* + branches: + - release/** + tags: + - v4.* # For test purpose only: # pull_request: @@ -12,44 +12,44 @@ on: # - '4.x' # types: [ opened, reopened, synchronize ] jobs: - build: - name: Build Packages - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: yarn - - run: yarn - - uses: actions/cache/save@v4 - with: - path: ./ - key: web3-e2e-18-${{github.sha}} - e2e: - name: E2E Network Tests - needs: build - runs-on: ubuntu-latest - env: - INFURA_SEPOLIA_HTTP: ${{ secrets.CS_ETH_SEPOLIA }} - INFURA_MAINNET_HTTP: ${{ secrets.CS_ETH_MAINNET }} - MODE: ${{ matrix.mode }} - TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0xa127C5E6a7E3600Ac34A9a9928E52521677e7211","mainnet":"0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d"}')[matrix.network] }} - ALLOWED_SEND_TRANSACTION: ${{ secrets.E2E_TESTS_ALLOWED_SEND_TRANSACTION }} - TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} - strategy: - fail-fast: false - matrix: - mode: ['http'] - network: ['sepolia', 'mainnet'] - steps: - - uses: actions/setup-node@v3 - with: - node-version: 18 - - uses: actions/cache/restore@v4 - with: - path: ./ - key: web3-e2e-18-${{github.sha}} - - run: | - yarn test:e2e:${{ matrix.network }}:${{ matrix.mode }} - shell: bash + build: + name: Build Packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + cache: yarn + - run: yarn + - uses: actions/cache/save@v4 + with: + path: ./ + key: web3-e2e-18-${{github.sha}} + e2e: + name: E2E Network Tests + needs: build + runs-on: ubuntu-latest + env: + INFURA_SEPOLIA_HTTP: ${{ secrets.CS_ETH_SEPOLIA }} + INFURA_MAINNET_HTTP: ${{ secrets.CS_ETH_MAINNET }} + MODE: ${{ matrix.mode }} + TEST_ACCOUNT_ADDRESS: ${{ fromJSON('{"sepolia":"0xa127C5E6a7E3600Ac34A9a9928E52521677e7211","mainnet":"0x98AF911164f9d4E0f5983ed114949c3Bfe3ADc9d"}')[matrix.network] }} + ALLOWED_SEND_TRANSACTION: ${{ secrets.E2E_TESTS_ALLOWED_SEND_TRANSACTION }} + TEST_ACCOUNT_PRIVATE_KEY: ${{ secrets.TEST_ACCOUNT_PRIVATE_KEY }} + strategy: + fail-fast: false + matrix: + mode: ['http'] + network: ['sepolia', 'mainnet'] + steps: + - uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache/restore@v4 + with: + path: ./ + key: web3-e2e-18-${{github.sha}} + - run: | + yarn test:e2e:${{ matrix.network }}:${{ matrix.mode }} + shell: bash diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d89cbdb6622..bc5e88ab6c9 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,19 +1,19 @@ -name: "Close stale issues" +name: 'Close stale issues' on: - schedule: - - cron: "0 0 * * *" + schedule: + - cron: '0 0 * * *' jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' - stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' - days-before-stale: 60 - days-before-close: 14 - operations-per-run: 100 - exempt-pr-labels: 'work-in-progress,4.x' - exempt-issue-labels: 'work-in-progress,4.x' + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' + stale-pr-message: 'This PR has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.' + days-before-stale: 60 + days-before-close: 14 + operations-per-run: 100 + exempt-pr-labels: 'work-in-progress,4.x' + exempt-issue-labels: 'work-in-progress,4.x'