From 06a0ddad93aeee95ba4ff06f56ca22d7270b6421 Mon Sep 17 00:00:00 2001 From: Matias Korhonen Date: Sat, 27 Jan 2024 14:26:53 +0200 Subject: [PATCH 1/3] Add macos-latest to the matrix --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 42188a0..60af026 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -42,7 +42,7 @@ jobs: test: strategy: matrix: - os: [ "ubuntu-latest", "windows-latest" ] + os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] runs-on: ${{ matrix.os }} From 8e01401d56ddcafbef95cb93575ec5e082de8c3a Mon Sep 17 00:00:00 2001 From: Matias Korhonen Date: Sat, 27 Jan 2024 14:35:30 +0200 Subject: [PATCH 2/3] Normal test output on macOS and Windows --- .github/workflows/rust.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 60af026..8b4332d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -94,12 +94,16 @@ jobs: ~/.cargo/git/db/ target/ key: test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Run tests + - name: Run tests (JSON output) + if: startsWith(matrix.os, 'ubuntu') run: cargo test --verbose -- -Z unstable-options --report-time --format json | tee test-output.json env: CARGO_INCREMENTAL: 0 RUSTFLAGS: -Cinstrument-coverage LLVM_PROFILE_FILE: cargo-test-%p-%m.profraw + - name: Run tests (normal output) + if: ! startsWith(matrix.os, 'ubuntu') + run: cargo test - name: Process code coverage with grcov if: startsWith(matrix.os, 'ubuntu') run: grcov . --binary-path ./target/debug/deps/ -s . -t cobertura --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/cobertura.xml From 169d1c8623b397c8c351c1642c66a91333cb681e Mon Sep 17 00:00:00 2001 From: Matias Korhonen Date: Sat, 27 Jan 2024 14:37:38 +0200 Subject: [PATCH 3/3] Correct the syntax --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8b4332d..bbeb59f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -102,7 +102,7 @@ jobs: RUSTFLAGS: -Cinstrument-coverage LLVM_PROFILE_FILE: cargo-test-%p-%m.profraw - name: Run tests (normal output) - if: ! startsWith(matrix.os, 'ubuntu') + if: ${{ !startsWith(matrix.os, 'ubuntu') }} run: cargo test - name: Process code coverage with grcov if: startsWith(matrix.os, 'ubuntu')