-
Notifications
You must be signed in to change notification settings - Fork 4
77 lines (73 loc) · 2.3 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
name: test
on:
push:
branches: [develop]
pull_request:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
required:
runs-on: ubuntu-latest
name: test (${{ matrix.toolchain }})
strategy:
matrix:
toolchain: [stable, beta]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: cargo test --locked
run: cargo test --locked --workspace -F reqwest,blocking,poem-openapi --all-targets
- name: cargo test --doc
run: cargo test --locked --workspace -F reqwest,blocking,poem-openapi --doc
integration:
runs-on: ubuntu-latest
name: integration (stable)
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup Nix
uses: cachix/install-nix-action@v23
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: sandkasten
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: install packages
run: nix profile install --profile pkgs .#packages.all
- name: integration tests
run: |
if [[ "$GITHUB_EVENT_NAME" = "schedule" ]] || [[ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]]; then
proptests=1024
else
proptests=32
fi
nix develop .#test --command sh -c "setup-nsjail && integration-tests $proptests"
- name: Upload to codecov.io
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' }}
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}