-
-
Notifications
You must be signed in to change notification settings - Fork 19
134 lines (111 loc) · 3.35 KB
/
test.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Format
run: cargo fmt --all -- --check
clippy:
needs: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: ⚡ Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
- name: Setup .NET
uses: actions/setup-dotnet@v3
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
dotnet-version: '7.x.x'
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build and run tests
run: cargo test
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust
uses: dtolnay/rust-toolchain@nightly
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x.x'
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Setup grcov
env:
TAG: v0.8.13
run: |
mkdir -p ~/.local/bin
curl -sL https://github.com/mozilla/grcov/releases/download/$TAG/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C ~/.local/bin
echo ~/.local/bin >> $GITHUB_PATH
- name: Run grcov
env:
PROJECT_NAME: pomsky
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
CARGO_INCREMENTAL: 0
run: |
cargo test
zip -0 cov.zip $(find . -name "$PROJECT_NAME*.gc*" -print)
grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info
- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: 'lcov.info'