-
Notifications
You must be signed in to change notification settings - Fork 85
72 lines (64 loc) · 1.92 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
name: Tests
on:
pull_request:
push:
branches:
- main
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
rustflags:
- '-C target-cpu=native'
- '-C target-cpu=native -C target-feature=-avx2'
- '-C target-cpu=native -C target-feature=-avx2,-pclmulqdq'
features:
- '--no-default-features'
- ''
- '--features value-no-dup-keys'
- '--features known-key'
- '--features 128bit'
- '--features beef'
- '--features beef,known-key'
- '--features beef,known-key,128bit'
- '--features approx-number-parsing'
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)
if: matrix.features == ''
env:
RUSTFLAGS: ${{ matrix.rustflags }}
run: cargo test --features alloc
- name: Run tests
env:
RUSTFLAGS: "-C target-cpu=native ${{ matrix.rustflags }}"
run: cargo llvm-cov --lcov --output-path lcov.txt --features no-inline ${{ matrix.features }}
- name: Generate matrix name
if: matrix.os == 'ubuntu-latest'
run: |
flags="${{ matrix.rustflags }}${{ matrix.features }}"
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