-
Notifications
You must be signed in to change notification settings - Fork 16
140 lines (140 loc) · 4.31 KB
/
ci.yaml
File metadata and controls
140 lines (140 loc) · 4.31 KB
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
135
136
137
138
139
140
name: CI
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
RUST_BACKTRACE: full
RUST_TOOLCHAIN: 1.92.0
jobs:
rustfmt:
name: Checks / Format
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component rustfmt
rustup override set ${{ env.RUST_TOOLCHAIN }}
- name: Format Check
run: make fmt
clippy:
name: Checks / Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal --component clippy
rustup override set ${{ env.RUST_TOOLCHAIN }}
# For wasm targets
rustup target add wasm32-unknown-unknown
- name: Lint Check
run: make clippy
- name: Lint Check (SQLite)
run: make clippy-sqlite
test-wasm:
name: Tests / Build & Test (Wasm)
needs: [ rustfmt, clippy ]
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Setup nodejs
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@v1.16.3
- name: Install dependencies
run: |
cargo binstall wasm-pack
- name: Build
run: |
make build-wasm
- name: Run unit-tests with wasm-pack
run: |
make test-wasm
test:
name: Tests / Build & Test
needs: [ rustfmt, clippy ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-2022 ]
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Windows Dependencies
if: matrix.os == 'windows-2022'
run: |
iwr -useb get.scoop.sh -outfile 'install-scoop.ps1'
.\install-scoop.ps1 -RunAsAdmin
echo "LIBCLANG_PATH=$($HOME)/scoop/apps/llvm/current/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop install llvm yasm
- name: Setup stack size on Windows
if: matrix.os == 'windows-2022'
run: |
$env:RUSTFLAGS="-C link-args=/STACK:67108864"
- name: Build
run: make build
- name: UnitTest
if: matrix.os != 'macos-latest'
run: make test
- name: UnitTest
if: matrix.os == 'macos-latest'
run: make test-portable
test-sqlite:
name: Tests / Build & Test (SQLite)
needs: [ rustfmt, clippy ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-2022 ]
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: UnitTest (SQLite)
run: make test-sqlite
code_coverage:
name: Code Coverage
needs: [ test ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
env:
OS: ${{ matrix.os }}
steps:
- name: Checkout the Repository
uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} --profile minimal
rustup override set ${{ env.RUST_TOOLCHAIN }}
- name: Install Grcov
run: make coverage-install-tools
- name: Generate Code Coverage Report of Unit Tests
run: |
make coverage-run-unittests
make coverage-collect-data
- name: Upload Code Coverage Report of Unit Tests
uses: codecov/codecov-action@v3
with:
files: coverage-report.info
env_vars: OS,RUST_TOOLCHAIN
fail_ci_if_error: false
flags: unittests
verbose: false
token: ${{ secrets.CODECOV_TOKEN }}