diff --git a/.github/actions/prep-ubuntu/action.yml b/.github/actions/prep-ubuntu/action.yml index d5fbf909e3..4c3bc192a0 100644 --- a/.github/actions/prep-ubuntu/action.yml +++ b/.github/actions/prep-ubuntu/action.yml @@ -3,8 +3,16 @@ description: cleanup and Rust Tools setup inputs: RUST_TOOLCHAIN: description: toolchain version - required: false default: "1.66" + cache: + description: cache type (enabled if set) + default: "disabled" + GWIP: + description: "Google Workload identity provider" + default: '' + GSA: + description: "Google Service Account" + default: '' runs: using: composite steps: @@ -25,10 +33,16 @@ runs: with: toolchain: ${{ inputs.RUST_TOOLCHAIN }} default: true - # - name: Install Rust Toolchain - # shell: bash - # id: install_toolchain - # env: - # RUST_TOOLCHAIN: inputs.RUST_TOOLCHAIN - # run: | - # ./scripts/install_toolchain.sh + + - name: SCcache setup + if: ${{ inputs.cache_type == 'enabled' }} + uses: ./.github/actions/sccache-gcloud + with: + GWIP: ${{ secrets.GWIP_SCCACHE }} + GSA: ${{ secrets.GSA_SCCACHE }} + + - name: setup Rust sccache wrapper + shell: sh + run: echo "RUSTC_WRAPPER="sccache"" >> $GITHUB_ENV + + diff --git a/.github/workflows/build-wasm.yml b/.github/workflows/build-wasm.yml index 8e89ca7a7a..8cefea1fea 100644 --- a/.github/workflows/build-wasm.yml +++ b/.github/workflows/build-wasm.yml @@ -33,21 +33,14 @@ jobs: uses: ./.github/actions/prep-ubuntu with: RUST_TOOLCHAIN: ${{ matrix.rust_version }} - + + # sccache does not work inside the srtool container - uses: Swatinem/rust-cache@e207df5d269b42b69c8bc5101da26f7d31feddb4 # 2.6.2 with: prefix-key: build shared-key: wasm # save-if: ${{ github.ref == 'refs/heads/master' }} - # TEST 2: Sccache with Google Buckets - # FAILED: does not work inside the srtool container - # - name: SCcache setup - # uses: ./.github/actions/sccache-gcloud - # with: - # GWIP: ${{ secrets.GWIP_SCCACHE }} - # GSA: ${{ secrets.GSA_SCCACHE }} - - name: Setup build options id: buildopt run: | diff --git a/.github/workflows/sanity-checks.yml b/.github/workflows/sanity-checks.yml index 32c5c79f36..2bdc59da5e 100644 --- a/.github/workflows/sanity-checks.yml +++ b/.github/workflows/sanity-checks.yml @@ -4,7 +4,7 @@ on: pull_request: paths: - 'src/' - - '.github/workflows/tests.yml' + - '.github/workflows/sanity-checks.yml' name: Sanity checks concurrency: group: 'tests-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' @@ -13,23 +13,15 @@ permissions: id-token: write contents: read jobs: - lint-test-build: - name: ${{ matrix.target }}${{ format('-{0}, matrix.runtime') || '' }} + test-n-lint: + name: ${{ matrix.target }} runs-on: ubuntu-latest-4-cores strategy: matrix: - target: [tests-general, test-integration, - lint-fmt, lint-clippy, cargo-build, benchmark-check] # ,lint-taplo] - include: - - target: benchmark-check - runtime: development - - target: benchmark-check - runtime: altair - - target: benchmark-check - runtime: centrifuge + target: [test-general, test-integration, + lint-fmt, lint-clippy, cargo-build] # ,lint-taplo] env: RUST_TOOLCHAIN: "nightly-2022-11-14" - # SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" steps: - name: Check out code @@ -39,29 +31,28 @@ jobs: uses: ./.github/actions/prep-ubuntu with: RUST_TOOLCHAIN: ${{ env.RUST_TOOLCHAIN }} - - # - name: Swatinem rust cache setup - # uses: Swatinem/rust-cache@b8a6852b4f997182bdea832df3f9e153038b5191 # 2.6.0 - # with: - # prefix-key: cache - # shared-key: cargo-tests - # # cache-on-failure: "true" - # # save-if: ${{ github.ref == 'refs/heads/master' }} - - - name: SCcache setup - uses: ./.github/actions/sccache-gcloud - with: - GWIP: ${{ secrets.GWIP_SCCACHE }} - GSA: ${{ secrets.GSA_SCCACHE }} + setup_cache: true + cache_type: sccache_gcloud - name: Runing cargo ${{ matrix.target }} run: ./ci/run-check.sh env: TARGET: ${{ matrix.target }} - RUNTIME: ${{ matrix.runtime }} - + # RUNTIME: ${{ matrix.runtime }} - # - name: Run tests - # run: ./ci/script.sh - # env: - # TARGET: ${{ matrix.target }} + benchmark-check: + name: bench-${{ matrix.runtime }} + runs-on: ubuntu-latest-4-cores + strategy: + matrix: + runtime: [development, altair, centrifuge] + env: + RUST_TOOLCHAIN: "nightly-2022-11-14" + steps: + - name: Check out code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab #3.5.2 + - name: Runing cargo ${{ matrix.target }} + run: ./ci/run-check.sh + env: + TARGET: benchmark-check + RUNTIME: ${{ matrix.runtime }}