From cd7ea1a8417e2bc27055e1532d9fa61c70ec327a Mon Sep 17 00:00:00 2001 From: Erik Burton Date: Tue, 7 May 2024 16:19:01 -0700 Subject: [PATCH] chore: fix contracts build w/ outdated container --- .../build_contract_artifacts/action.yml | 6 +- .github/workflows/e2e_custom_cl.yml | 8 +- .github/workflows/e2e_testnet_daily.yml | 2 +- .github/workflows/rust.yml | 73 +++++++++---------- 4 files changed, 46 insertions(+), 43 deletions(-) diff --git a/.github/actions/build_contract_artifacts/action.yml b/.github/actions/build_contract_artifacts/action.yml index c8cbf432a..ebc3d2298 100644 --- a/.github/actions/build_contract_artifacts/action.yml +++ b/.github/actions/build_contract_artifacts/action.yml @@ -17,12 +17,12 @@ runs: apt update apt install git -y git config --global --add safe.directory "$GITHUB_WORKSPACE" - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: repository: smartcontractkit/chainlink-solana ref: ${{ inputs.ref }} - name: Setup go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + uses: actions/setup-go@v4 with: go-version-file: "go.mod" check-latest: true @@ -47,7 +47,7 @@ runs: run: anchor build working-directory: contracts - name: Upload Artifacts - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: artifacts path: contracts/target/deploy diff --git a/.github/workflows/e2e_custom_cl.yml b/.github/workflows/e2e_custom_cl.yml index 1ff07d3f2..9d5225ea3 100644 --- a/.github/workflows/e2e_custom_cl.yml +++ b/.github/workflows/e2e_custom_cl.yml @@ -62,7 +62,9 @@ jobs: FORCE_COLOR: 1 steps: - name: Checkout the repo - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + # Use v3.6.0 because the custom runner (container configured above) + # doesn't have node20 installed which is required for versions >=4 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Build contracts uses: ./.github/actions/build_contract_artifacts @@ -146,8 +148,10 @@ jobs: fi - name: Checkout the repo uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + # Use v3-node20 because the build_contract_artfifacts action must use the node16 actions/upload-artifact@v3 + # due to tech-debt. actions/download-artifact@v4 is not compatible with actions/upload-artifact@v3. - name: Download Artifacts - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@246d7188e736d3686f6d19628d253ede9697bd55 # v3-node20 with: name: artifacts path: ${{ env.CONTRACT_ARTIFACTS_PATH }} diff --git a/.github/workflows/e2e_testnet_daily.yml b/.github/workflows/e2e_testnet_daily.yml index 053a19654..57b766df5 100644 --- a/.github/workflows/e2e_testnet_daily.yml +++ b/.github/workflows/e2e_testnet_daily.yml @@ -160,7 +160,7 @@ jobs: - name: Checkout the solana repo # Use v3.6.0 because the custom runner (container configured above) # doesn't have node20 installed which is required for versions >=4 - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: repository: smartcontractkit/chainlink-solana ref: ${{ needs.get_solana_sha.outputs.sha }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3c278448c..5300a705f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,40 +31,39 @@ jobs: env: RUSTUP_HOME: "/root/.rustup" FORCE_COLOR: 1 - steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 - - name: Cache cargo registry - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo target dir - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 - with: - path: contracts/target - key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - - - run: solana-keygen new -o id.json --no-bip39-passphrase - - name: Compile typescript client - run: | - cd ../ts - yarn install --frozen-lockfile - yarn build - - run: yarn install --frozen-lockfile - - run: anchor test - - run: | - cd examples/hello-world - yarn install --frozen-lockfile - anchor test - + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - name: Cache cargo registry + uses: actions/cache@v2.1.7 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo index + uses: actions/cache@v2.1.7 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} + + - name: Cache cargo target dir + uses: actions/cache@v2.1.7 + with: + path: contracts/target + key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + - run: solana-keygen new -o id.json --no-bip39-passphrase + - name: Compile typescript client + run: | + cd ../ts + yarn install --frozen-lockfile + yarn build + - run: yarn install --frozen-lockfile + - run: anchor test + - run: | + cd examples/hello-world + yarn install --frozen-lockfile + anchor test + rust_lint: name: Rust Lint runs-on: ubuntu-latest @@ -76,21 +75,21 @@ jobs: FORCE_COLOR: 1 steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - name: Cache cargo registry - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v2.1.7 with: path: ~/.cargo/registry key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo index - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v2.1.7 with: path: ~/.cargo/git key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} - name: Cache cargo target dir - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + uses: actions/cache@v2.1.7 with: path: contracts/target key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}