forked from simd-lite/simd-json
-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (122 loc) · 4.43 KB
/
tests.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
rustflags:
- ''
- '-C target-feature=-avx2'
- '-C target-feature=-avx2,-pclmulqdq'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run tests (alloc)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo test --features alloc
- name: llvm-cov - Clean
run: cargo llvm-cov clean --workspace
- name: Run tests
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report
- name: Run tests (no-default-features)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report
- name: Run tests (value-no-dup-keys)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features value-no-dup-keys
- name: Run tests (known-key)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features known-key
- name: Run tests (128bit)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features 128bit
- name: Run tests (beef)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features beef
- name: Run tests (arraybackend)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features arraybackend
- name: Run tests (approx-number-parsing)
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --no-report --features approx-number-parsing
- name: llvm-cov - Report
run: cargo llvm-cov report --lcov --output-path lcov.txt
- name: Generate matrix name
if: matrix.os == 'ubuntu-latest'
run: |
flags="${{ matrix.rustflags }}"
flags="${flags/-C target-feature=/}"
flags="${flags//[- ]/}"
echo "$flags"
echo "flags=$flags" >> $GITHUB_ENV
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: Wandalen/wretry.action@master
with:
action: codecov/codecov-action@v3
attempt_limit: 6
attempt_delay: 10000
with: |
files: ./lcov.txt
flags: unittests
verbose: true
test-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasi
- name: Install wasmtime
run: cargo install wasmtime-cli
- name: Run tests
run: |
cargo build --tests --target-dir target --target wasm32-wasi
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (no-default-features)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --no-default-features
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (no-inline)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --features no-inline
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (value-no-dup-keys)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --features value-no-dup-keys
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (128bit)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --features 128bit
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (beef)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --features beef
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm
- name: Run tests (approx-number-parsing)
run: |
cargo build --tests --target-dir target --target wasm32-wasi --features approx-number-parsing
wasmtime run target/wasm32-wasi/debug/deps/simd_json*.wasm