-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (127 loc) · 4.28 KB
/
rust.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
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: '-D warnings'
jobs:
format:
name: Verify code Fromatting
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Format
run: cargo fmt --all -- --check
lint:
name: Lint with clippy
needs: format
strategy:
fail-fast: true
runs-on: "ubuntu-latest"
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Install clippy
run: rustup component add clippy --toolchain nightly
- name: Lint
run: cargo clippy --workspace --all-targets --verbose --all-features
# bench:
# name: Check that benchmarks compile
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# - name: Build u32 bench
# env:
# RUSTFLAGS: '--cfg curve25519_dalek_bits="32"'
# run: cargo build --benches
# - name: Build u64 bench
# env:
# RUSTFLAGS: '--cfg curve25519_dalek_bits="64"'
# run: cargo build --benches
# - name: Build default (host native) bench
# run: cargo build --benches
test-stable:
name: Test 32/64 bit stable
runs-on: ubuntu-latest
strategy:
matrix:
include:
# 32-bit target
- target: i686-unknown-linux-gnu
deps: >
sudo dpkg --add-architecture i386;
sudo touch /etc/apt/sources.list.d/i386-cross-compile-sources.list;
echo "deb [arch=i386] http://ports.ubuntu.com/ focal universe\ndeb [arch=i386] http://ports.ubuntu.com/ focal-updates universe\n" | sudo tee -a /etc/apt/sources.list.d/i386-cross-compile-sources.list;
sudo apt update && sudo apt install gcc-multilib libsqlite3-dev:i386
# 64-bit target
- target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add ${{ matrix.target }}
- run: ${{ matrix.deps }}
- run: cargo test --target ${{ matrix.target }} --workspace --all-targets --all-features
# - run: cargo test --target ${{ matrix.target }} --workspace --all-targets
# - run: cargo test --target ${{ matrix.target }} --workspace --all-targets --no-default-features
test-nightly:
name: Test Nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo test --workspace --all-targets
msrv:
name: Check Crates against MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Re-resolve Cargo.lock with minimal versions
- uses: dtolnay/rust-toolchain@nightly
- run: cargo update -Z minimal-versions
# Now check that `cargo build` works with respect to the oldest possible
# deps and the stated MSRV. 1.70 should work for all
- uses: dtolnay/[email protected]
- run: cargo test --workspace --all-targets --all-features
# Also make sure the AVX2 build works
- run: cargo build --target x86_64-unknown-linux-gnu
# The PTRS crate has fewer dependencies and a lower msrv
- uses: dtolnay/[email protected]
- run: cargo test -p ptrs --all-targets --all-features
- run: cargo build -p ptrs --target x86_64-unknown-linux-gnu
build:
name: Build
needs: format
# needs: [format, lint]
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
# Build ptrs library
- name: Build library and bins
run: cargo build
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
- name: Codecov
uses: codecov/[email protected]
with:
fail_ci_if_error: true
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true
slug: jmwample/ptrs