Skip to content

Commit

Permalink
Run tests on Windows (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiaskorhonen authored Jan 27, 2024
1 parent ee82d98 commit 7197464
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand All @@ -40,31 +40,40 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ "ubuntu-latest", "windows-latest" ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Create local bin directory
if: startsWith(matrix.os, 'ubuntu')
run: mkdir -p "${HOME}/.local/bin"
- name: Download markdown-test-report
if: startsWith(matrix.os, 'ubuntu')
uses: robinraju/release-downloader@v1.8
with:
repository: "ctron/markdown-test-report"
tag: "v0.3.8"
fileName: markdown-test-report-linux-amd64
out-file-path: tmp
- name: Install markdown-test-report
if: startsWith(matrix.os, 'ubuntu')
run: |
mv tmp/markdown-test-report-linux-amd64 "${HOME}/.local/bin/markdown-test-report"
chmod +x "${HOME}/.local/bin/markdown-test-report"
- name: Download grcov
if: startsWith(matrix.os, 'ubuntu')
uses: robinraju/release-downloader@v1.8
with:
repository: "mozilla/grcov"
tag: "v0.8.18"
fileName: grcov-x86_64-unknown-linux-gnu.tar.bz2
out-file-path: tmp
- name: Install grcov
if: startsWith(matrix.os, 'ubuntu')
run: |
tar -xvf tmp/grcov-x86_64-unknown-linux-gnu.tar.bz2
mv grcov "${HOME}/.local/bin"
Expand Down Expand Up @@ -92,23 +101,29 @@ jobs:
RUSTFLAGS: -Cinstrument-coverage
LLVM_PROFILE_FILE: cargo-test-%p-%m.profraw
- 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
- name: Upload coverage reports to Codecov
if: startsWith(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v3
with:
files: target/cobertura.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Job summary (tests)
if: ${{ always() }}
run: "[ -f test-output.json ] && markdown-test-report --no-front-matter --output - >> $GITHUB_STEP_SUMMARY"
shell: bash
run: |
[ -f test-output.json ] && \
command -v markdown-test-report &> /dev/null && \
markdown-test-report --no-front-matter --output - >> $GITHUB_STEP_SUMMARY || true
continue-on-error: true

build-binary:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure cache
Expand Down Expand Up @@ -138,7 +153,7 @@ jobs:
PAPERAGE_PASSPHRASE: supersecret

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
Expand Down

0 comments on commit 7197464

Please sign in to comment.