75 lines (63 loc) · 2 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
name: "Run tests with workflow_call"
on:
workflow_call:
inputs:
ref:
description: "git ref to checkout to"
type: string
default: "master"
cargo-dependencies:
description: "Cargo dependencies map"
type: string
default: "null"
test-retries:
description: "How many times to retry tests"
type: string
default: "3"
env:
RUSTFLAGS: "-D warnings --cfg tokio_unstable -C link-arg=-B/usr/local/bin/mold"
RUSTC_WRAPPER: "sccache"
jobs:
tests:
name: "cargo nextest"
runs-on: builder
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: fluencelabs/nox
ref: ${{ inputs.ref }}
- name: Setup Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
cache-directories: ~/.cache/sccache
shared-key: nox-tests
# github allows only 10GB of cache
# so save cache only on merge to master
# to use less space and speed up CI
save-if: ${{ github.event_name == 'push' }}
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Setup mold linker
uses: rui314/setup-mold@v1
with:
make-default: false
- name: Setup nextest
uses: taiki-e/install-action@nextest
- name: Set dependencies
if: inputs.cargo-dependencies != 'null'
uses: fluencelabs/github-actions/cargo-set-dependency@main
with:
dependencies: ${{ inputs.cargo-dependencies }}
- name: Run cargo nextest
run: cargo nextest run --release --all-features --profile ci --retries ${{ inputs.test-retries }}
- name: Upload test report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: nox report
path: target/nextest/ci/junit.xml
reporter: java-junit