-
-
Notifications
You must be signed in to change notification settings - Fork 8
133 lines (114 loc) · 2.92 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
name: Test
on:
workflow_call: { }
push:
branches:
- master
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- .github/workflows/release.yml
- LICENSE
- .gitignore
pull_request:
paths-ignore:
- .github/CODE_OF_CONDUCT.md
- .github/CODEOWNERS
- .github/dependabot.yml
- .github/FUNDING.yml
- .github/workflows/release.yml
- LICENSE
- .gitignore
permissions:
contents: read
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: --deny warnings
RUSTDOCFLAGS: --deny warnings
jobs:
doc:
name: Doc build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
cache-prefix: doc
local: true
- name: Doc
run: cargo doc --workspace --no-deps --locked
- name: Cleanup
run: rm -rf target/doc
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
id: toolchain
with:
components: rustfmt,clippy
cache-prefix: lint
local: true
- name: Fmt
run: cargo fmt --check
- name: Clippy
run: cargo clippy --workspace --tests --all-features --locked --no-deps
unit:
name: Test on ${{ matrix.toolchain }} with ${{ matrix.flags || 'no features' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- nightly-2024-07-25
- stable
- 1.75.0
flags:
- ''
- --all-features
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init toolchain
uses: alorel-actions/cargo/init@v1
with:
toolchain: ${{matrix.toolchain}}
cache-prefix: test
local: true
- name: Build
run: cargo build --locked ${{ matrix.flags }}
- name: Install wasm-pack
uses: alorel-actions/cargo-global-dep@v1
with:
name: wasm-pack
version: 0.13.0
- name: Test (Chrome)
run: wasm-pack test --headless --chrome --locked --package idb_test ${{ matrix.flags }}
- name: Test (Firefox)
run: wasm-pack test --headless --firefox --locked --package idb_test ${{ matrix.flags }}
done:
name: All tests
runs-on: ubuntu-latest
needs:
- doc
- lint
- unit
steps:
- uses: actions/checkout@v4
name: Checkout
with:
fetch-depth: 0
fetch-tags: true
- name: Generate changelog
id: changelog
uses: ./.github/actions/changelog
- name: Echo changelog
run: echo -e "${{ steps.changelog.outputs.changelog }}"