From 03bd5d5da76cfe00948920b9a3604aa2d0c9bc98 Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Fri, 19 Apr 2024 11:29:21 +0200 Subject: [PATCH] rpc tests on demand --- .../workflows/composite/rpc_test/action.yml | 50 +++++++++++++++++++ .github/workflows/forest.yml | 37 ++------------ 2 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/composite/rpc_test/action.yml diff --git a/.github/workflows/composite/rpc_test/action.yml b/.github/workflows/composite/rpc_test/action.yml new file mode 100644 index 000000000000..71eed8704df8 --- /dev/null +++ b/.github/workflows/composite/rpc_test/action.yml @@ -0,0 +1,50 @@ +name: RPC tests composite action + +description: | + This action runs the RPC conformance tests + +inputs: + FIL_PROOFS_PARAMETER_CACHE: + required: true + SHELL_IMAGE: + required: true + +runs: + using: "composite" + steps: + - uses: actions/cache@v4 + id: cache + with: + path: '${{ inputs.FIL_PROOFS_PARAMETER_CACHE }}' + key: proof-params-keys + - name: Load cache into volume + if: steps.cache.outputs.cache-hit == 'true' + run: | + docker volume create api_compare_filecoin-proofs + docker run --rm \ + -v api_compare_filecoin-proofs:/proofs \ + -v ${{ inputs.FIL_PROOFS_PARAMETER_CACHE }}:/cache \ + ${{ inputs.SHELL_IMAGE }} \ + sh -c "cp /cache/* /proofs" + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: 'forest-${{ runner.os }}' + - name: Run api compare tests + run: ./scripts/tests/api_compare/setup.sh + timeout-minutes: 30 + env: + # We use a custom Dockerfile for CI to speed up the build process. + FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile + - name: Dump docker logs + if: always() + uses: jwalton/gh-docker-logs@v2 + - name: Prepare cache folder for uploading + if: steps.cache.outputs.cache-hit != 'true' + run: | + docker run --rm \ + -v api_compare_filecoin-proofs:/proofs \ + -v ${{ inputs.FIL_PROOFS_PARAMETER_CACHE }}:/cache \ + ${{ inputs.SHELL_IMAGE }} \ + sh -c "cp /proofs/* /cache" + sudo chmod -R 755 ${{ inputs.FIL_PROOFS_PARAMETER_CACHE }} diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index 99d108debfed..6a1150bcff6a 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -372,40 +372,9 @@ jobs: - build-ubuntu name: Calibnet RPC checks runs-on: ubuntu-latest - env: - # We use a custom Dockerfile for CI to speed up the build process. - FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile steps: - - uses: actions/cache@v4 - id: cache - with: - path: '${{ env.FIL_PROOFS_PARAMETER_CACHE }}' - key: proof-params-keys - - name: Load cache into volume - if: steps.cache.outputs.cache-hit == 'true' - run: | - docker volume create api_compare_filecoin-proofs - docker run --rm \ - -v api_compare_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ - sh -c "cp /cache/* /proofs" - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - uses: ./.github/workflows/composite/rpc_test with: - name: 'forest-${{ runner.os }}' - - name: Run api compare tests - run: ./scripts/tests/api_compare/setup.sh - timeout-minutes: '${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}' - - name: Dump docker logs - if: always() - uses: jwalton/gh-docker-logs@v2 - - name: Prepare cache folder for uploading - if: steps.cache.outputs.cache-hit != 'true' - run: | - docker run --rm \ - -v api_compare_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ - sh -c "cp /proofs/* /cache" - sudo chmod -R 755 $FIL_PROOFS_PARAMETER_CACHE + FIL_PROOFS_PARAMETER_CACHE: ${{ env.FIL_PROOFS_PARAMETER_CACHE }} + SHELL_IMAGE: ${{ env.SHELL_IMAGE }}