ci: cache less things to make it more efficient

also removes the jobs for testing with Rust beta and nightly
This commit is contained in:
Quentin Gliech
2023-07-27 17:48:51 +02:00
parent a8544467b2
commit a94ba97b5b
3 changed files with 13 additions and 33 deletions

View File

@@ -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

View File

@@ -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: |

View File

@@ -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