-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (46 loc) · 1.7 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Credit to GitHub Copilot for generating this file
name: Rust CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Build
run: cargo build --all-features --verbose
- name: Test
run: cargo test --all-features --verbose
# This should only happen on push to main. PRs should not upload coverage.
- name: Install llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
- name: Install nextest
uses: taiki-e/install-action@nextest
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
- name: Write API key to api.key
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: echo ${{ secrets.ANTHROPIC_API_KEY }} > api.key
- name: Collect coverage data (including ignored tests)
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
run: cargo llvm-cov nextest --all-features --run-ignored all --lcov --output-path lcov.info
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true