diff --git a/.github/actions/bazelisk/action.yml b/.github/actions/bazelisk/action.yml index 9fc07088..fcaa81a3 100644 --- a/.github/actions/bazelisk/action.yml +++ b/.github/actions/bazelisk/action.yml @@ -3,6 +3,21 @@ description: Install bazelisk runs: using: composite steps: + # Cache bazel build on linux. (MacOS uses the local cache on the runner.) + - name: Get Date + id: get-date + run: | + echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT + shell: bash + - if: matrix.os == 'Linux' + uses: actions/cache@v4 + env: + cache-name: bazel-build + with: + path: "~/.cache/bazel" + # Generate a new build cache once a day, reusing the previous day's if available + key: "bazel-${{ matrix.os }}-${{ steps.get-date.outputs.date }}" + restore-keys: "bazel-${{ matrix.os }}-" - if: runner.os == 'Linux' run: | echo "BAZELISK_OS=linux" >> $GITHUB_ENV diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bf0054bf..27c28709 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,6 +42,18 @@ jobs: python-version: "3.10" - run: python license-check.py + check-generated-zirgen: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + circuit: [fib, calculator] + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/bazelisk + - name: ${{ matrix.circuit }} generated files up to date + run: cargo bootstrap -- --check ${{ matrix.circuit }} + bazel: runs-on: [self-hosted, prod, cpu, "${{ matrix.os }}"] strategy: @@ -52,22 +64,7 @@ jobs: - os: Linux config: --config=ci steps: - - name: Get Date - id: get-date - run: | - echo "date=$(/bin/date -u "+%Y-%m-%d")" >> $GITHUB_OUTPUT - shell: bash - uses: actions/checkout@v3 - # Cache bazel build on linux. (MacOS uses the local cache on the runner.) - - if: matrix.os == 'Linux' - uses: actions/cache@v4 - env: - cache-name: bazel-build - with: - path: "~/.cache/bazel" - # Generate a new build cache once a day, reusing the previous day's if available - key: "bazel-${{ matrix.os }}-${{ steps.get-date.outputs.date }}" - restore-keys: "bazel-${{ matrix.os }}-" - uses: ./.github/actions/bazelisk - name: Build & test env: @@ -139,6 +136,7 @@ jobs: - bazel - test - doc + - check-generated-zirgen runs-on: ubuntu-latest steps: - name: Check all job status