diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index 575df306058..996fb4ac507 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -4,9 +4,6 @@ inputs: only-modules: description: Set to 'true' to only cache modules default: 'false' - matrix-id: - description: Job caches can have key collisions when used in a matrix so we need to pass a unique id in for these cases - default: "1" cache-version: description: Set this to cache bust default: "1" @@ -39,9 +36,9 @@ runs: ${{ steps.go-cache-dir.outputs.gomodcache }} # The lifetime of go modules is much higher than the build outputs, so we increase cache efficiency # here by not having the primary key contain the branch name - key: ${{ runner.os }}-gomod-${{ inputs.matrix-id }}-${{ inputs.cache-version }}-${{ hashFiles('./go.sum') }} + key: ${{ runner.os }}-gomod-${{ inputs.cache-version }}-${{ hashFiles('./go.sum') }} restore-keys: | - ${{ runner.os }}-gomod-${{ inputs.matrix-id }}-${{ inputs.cache-version }}- + ${{ runner.os }}-gomod-${{ inputs.cache-version }}- - uses: actions/cache@v3 if: ${{ inputs.only-modules == 'false' }} diff --git a/.github/workflows/ci-core.yml b/.github/workflows/ci-core.yml index 6d243a62322..b55b69e293c 100644 --- a/.github/workflows/ci-core.yml +++ b/.github/workflows/ci-core.yml @@ -153,8 +153,6 @@ jobs: prod: "true" - name: Setup Go uses: ./.github/actions/setup-go - with: - matrix-id: ${{ matrix.cmd }}-${{ matrix.split.id }} - name: Setup Solana uses: ./.github/actions/setup-solana - name: Setup wasmd diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 943ddff4b76..afda0d393b0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -174,7 +174,7 @@ jobs: ## Run this step when changes that require tests to be run are made - name: Run Tests if: needs.changes.outputs.src == 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.8 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.9 env: TESTCONTAINERS_RYUK_DISABLED: true PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 @@ -190,7 +190,8 @@ jobs: publish_check_name: EVM Smoke Test Results ${{ matrix.product.name }} token: ${{ secrets.GITHUB_TOKEN }} go_mod_path: ./integration-tests/go.mod - matrix_id: ${{ matrix.product.name }} + cache_key_id: core-e2e + cache_restore_only: 'true' QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} @@ -198,11 +199,12 @@ jobs: ## Run this step when changes that do not need the test to run are made - name: Run Setup if: needs.changes.outputs.src == 'false' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@v2.2.8 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@v2.2.9 with: test_download_vendor_packages_command: cd ./integration-tests && go mod download go_mod_path: ./integration-tests/go.mod - matrix_id: ${{ matrix.product.name }} + cache_key_id: core-e2e + cache_restore_only: 'true' QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} @@ -390,7 +392,7 @@ jobs: ## Run this step when changes that require tests to be run are made - name: Run Tests if: needs.changes.outputs.src == 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.8 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.9 env: PYROSCOPE_SERVER: ${{ matrix.product.pyroscope_env == '' && '' || !startsWith(github.ref, 'refs/tags/') && '' || secrets.QA_PYROSCOPE_INSTANCE }} # Avoid sending blank envs https://github.com/orgs/community/discussions/25725 PYROSCOPE_ENVIRONMENT: ${{ matrix.product.pyroscope_env }} @@ -405,18 +407,20 @@ jobs: publish_check_name: EVM Smoke Test Results ${{ matrix.product.name }} token: ${{ secrets.GITHUB_TOKEN }} go_mod_path: ./integration-tests/go.mod - matrix_id: ${{ matrix.product.name }} + cache_key_id: core-e2e + cache_restore_only: 'true' QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} ## Run this step when changes that do not need the test to run are made - name: Run Setup if: needs.changes.outputs.src == 'false' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@v2.2.8 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@v2.2.9 with: test_download_vendor_packages_command: cd ./integration-tests && go mod download go_mod_path: ./integration-tests/go.mod - matrix_id: ${{ matrix.product.name }} + cache_key_id: core-e2e + cache_restore_only: 'true' QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }} @@ -459,6 +463,26 @@ jobs: hostname: ${{ secrets.GRAFANA_CLOUD_HOST }} this-job-name: ETH Smoke Tests continue-on-error: true + + # Run the setup if the matrix finishes but this time save the cache if we have a cache hit miss + # this will also only run if both of the matrix jobs pass + eth-smoke-go-mod-cache: + environment: integration + needs: [eth-smoke-tests] + runs-on: ubuntu-latest + name: ETH Smoke Tests Go Mod Cache + steps: + - name: Checkout the repo + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} + - name: Run Setup + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-go@v2.2.9 + with: + test_download_vendor_packages_command: cd ./integration-tests && go mod download + go_mod_path: ./integration-tests/go.mod + cache_key_id: core-e2e + cache_restore_only: 'false' ### Migration tests node-migration-tests: @@ -734,7 +758,7 @@ jobs: ref: ${{ needs.get_solana_sha.outputs.sha }} - name: Run Tests if: needs.changes.outputs.src == 'true' - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.7 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.9 with: test_command_to_run: export ENV_JOB_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-solana-tests:${{ needs.get_solana_sha.outputs.sha }} && make test_smoke cl_repo: ${{ env.CHAINLINK_IMAGE }} @@ -742,6 +766,7 @@ jobs: artifacts_location: /home/runner/work/chainlink-solana/chainlink-solana/integration-tests/logs publish_check_name: Solana Smoke Test Results go_mod_path: ./integration-tests/go.mod + cache_key_id: core-e2e token: ${{ secrets.GITHUB_TOKEN }} QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} @@ -796,7 +821,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }} ## Only run OCR smoke test for now - name: Run Tests - uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.7 + uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@v2.2.9 env: PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }} PYROSCOPE_ENVIRONMENT: ci-smoke-ocr-evm-${{ matrix.testnet }} # TODO: Only for OCR for now @@ -811,6 +836,8 @@ jobs: publish_check_name: ${{ matrix.testnet }} OCR Smoke Test Results token: ${{ secrets.GITHUB_TOKEN }} go_mod_path: ./integration-tests/go.mod + cache_key_id: core-e2e + cache_restore_only: 'true' QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }} QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}