This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (89 loc) · 2.75 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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update stable && rustup default stable
- run: rustup component add clippy
- run: cargo clippy -- -D warnings
test:
runs-on: ${{ matrix.os }}
env:
CARGO_PROFILE_DEV_DEBUG: 1
CARGO_PROFILE_TEST_DEBUG: 1
CARGO_INCREMENTAL: 0
CARGO_PUBLIC_NETWORK_TESTS: 1
# Deny warnings on CI to avoid warnings getting into the codebase.
RUSTFLAGS: -D warnings
strategy:
matrix:
include:
- name: Linux x86_64 stable
os: ubuntu-latest
rust: stable
- name: Linux x86_64 beta
os: ubuntu-latest
rust: beta
- name: Linux x86_64 nightly
os: ubuntu-latest
rust: nightly
- name: macOS x86_64 stable
os: macos-latest
rust: stable
- name: macOS x86_64 nightly
os: macos-latest
rust: nightly
- name: Windows x86_64 MSVC stable
os: windows-latest
rust: stable-msvc
- name: Windows x86_64 gnu nightly # runs out of space while trying to link the test suite
os: windows-latest
rust: nightly-gnu
name: Tests ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo test
- run: cargo build --features=vendored-openssl
if: >
matrix.name == 'Linux x86_64 stable' ||
matrix.name == 'Linux x86_64 beta' ||
matrix.name == 'Linux x86_64 nightly' ||
matrix.name == 'macOS x86_64 stable' ||
matrix.name == 'macOS x86_64 nightly'