-
Notifications
You must be signed in to change notification settings - Fork 44
116 lines (100 loc) · 2.57 KB
/
test-build.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
name: test-build
permissions:
contents: write
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_call:
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
defaults:
run:
shell: bash
jobs:
test-linux:
strategy:
matrix:
include:
- target: aarch64-unknown-linux-musl
arch: aarch64-musl
- target: x86_64-unknown-linux-musl
arch: x86_64-musl
runs-on: ubuntu-latest
container: messense/rust-musl-cross:${{ matrix.arch }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.target }}
components: rust-std,rustfmt,clippy
- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy || true
#
- name: Run tests
if: matrix.arch == 'x86_64-musl'
run: cargo test --verbose
- name: release
if: success()
run: cargo build --release --target=${{ matrix.target }}
- name: benchmarks
if: matrix.arch == 'x86_64-musl'
run: cargo bench
- name: upload benchmark output
if: matrix.arch == 'x86_64-musl'
uses: actions/upload-artifact@v3
with:
name: bench-results
path: benches/halo2_bench_timing.txt
test-macos:
strategy:
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.target }}
components: rust-std,rustfmt,clippy
- name: Lint
run: |
cargo fmt --all -- --check
cargo clippy || true
- name: Run tests
if: matrix.target == 'x86_64-apple-darwin'
run: cargo test --verbose
- name: release
if: success()
run: cargo build --release --target=${{ matrix.target }}