From a94ba97b5b2f86f599e0cede8b75434e043adc0d Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Thu, 27 Jul 2023 17:48:51 +0200 Subject: [PATCH] ci: cache less things to make it more efficient also removes the jobs for testing with Rust beta and nightly --- .github/workflows/ci.yaml | 36 +++++++++------------------------ .github/workflows/coverage.yaml | 6 ++---- .github/workflows/docs.yaml | 4 ++-- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b36e42db..5c014aa96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,8 +54,6 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -81,8 +79,6 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -132,13 +128,13 @@ jobs: - name: Setup Rust cache uses: Swatinem/rust-cache@v2.5.1 + with: + save-if: "${{ github.event_name != 'pull_request' }}" - name: Install Node uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -193,6 +189,8 @@ jobs: - name: Setup Rust cache uses: Swatinem/rust-cache@v2.5.1 + with: + save-if: "${{ github.event_name != 'pull_request' }}" - name: Run clippy run: | @@ -200,21 +198,13 @@ jobs: test: - name: Run test suite with Rust ${{ matrix.toolchain }} + name: Run test suite with Rust stable needs: [rustfmt, opa-lint] runs-on: ubuntu-latest permissions: contents: read - strategy: - fail-fast: false # Continue other jobs if one fails to help filling the cache - matrix: - toolchain: - - stable - - beta - - nightly - services: postgres: image: docker.io/library/postgres:15.3 @@ -236,15 +226,13 @@ jobs: - name: Install toolchain run: | - rustup toolchain install ${{ matrix.toolchain }} - rustup default ${{ matrix.toolchain }} + rustup toolchain install stable + rustup default stable - name: Install Node uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -265,6 +253,8 @@ jobs: - name: Setup Rust cache uses: Swatinem/rust-cache@v2.5.1 + with: + save-if: "${{ github.event_name != 'pull_request' }}" - name: Test id: test @@ -274,14 +264,6 @@ jobs: run: | cargo test --workspace - # Ignore errors on the nightly toolchain - continue-on-error: "${{ matrix.toolchain == 'nightly' }}" - - - name: Emit error annotation on failures - if: steps.test.outcome == 'failure' - run: | - echo "::error ::Test suite failed on ${{ matrix.toolchain }} toolchain" - build-image: name: Build and push Docker image diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index fb7e7936b..d10684c65 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -56,8 +56,6 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -109,8 +107,6 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Install Node dependencies working-directory: ./frontend @@ -131,6 +127,8 @@ jobs: - name: Setup Rust cache uses: Swatinem/rust-cache@v2.5.1 + with: + save-if: "${{ github.event_name != 'pull_request' }}" - name: Download grcov run: | diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3d97164bb..a9b986309 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,6 +29,8 @@ jobs: - name: Setup Rust cache uses: Swatinem/rust-cache@v2.5.1 + with: + save-if: "${{ github.event_name != 'pull_request' }}" - name: Setup mdBook uses: peaceiris/actions-mdbook@v1.2.0 @@ -39,8 +41,6 @@ jobs: uses: actions/setup-node@v3.7.0 with: node-version: 18 - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - name: Build the documentation run: sh misc/build-docs.sh