-
Notifications
You must be signed in to change notification settings - Fork 3
130 lines (125 loc) · 3.83 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 14 * * 1" # Mondays at 2pm UTC
workflow_dispatch: null
jobs:
cargo-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# different operating systems
os: [ubuntu-22.04, macos-13, windows-2019]
features: [default]
toolchain: [stable]
include:
# different features combinations
- os: ubuntu-22.04
features: beta
- os: ubuntu-22.04
features: blocking
- os: ubuntu-22.04
features: blocking,beta
# different tls implementations
- os: ubuntu-22.04
features: tls-rustls --no-default-features
- os: ubuntu-22.04
features: tls-vendored-openssl --no-default-features
- os: ubuntu-22.04
toolchain: beta
features: default
# MSRV
- os: ubuntu-22.04
toolchain: 1.75.0
features: default
steps:
- uses: actions/checkout@v4
- if: matrix.toolchain != ''
uses: IronCoreLabs/rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- name: Decrypt test keys
uses: IronCoreLabs/ironhide-actions/decrypt@v3
with:
keys: ${{ secrets.IRONHIDE_KEYS }}
input: tests/testkeys/iak-stage.pem.iron
# Generate the Cargo.lock that will be used for the tests so we can upload it as an artifact
- name: Generate lockfile
run: cargo generate-lockfile
- name: Upload Cargo.lock
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.features }}-${{ matrix.toolchain }}-Cargo.lock
path: Cargo.lock
- name: Install protobuf-codegen
run: cargo install protobuf-codegen
- name: Cargo test
run: cargo test --features ${{ matrix.features }}
env:
IRONCORE_ENV: stage
cargo-build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
target:
- aarch64-linux-android
- armv7-linux-androideabi
- i686-linux-android
- x86_64-linux-android
- x86_64-unknown-linux-musl
os:
- ubuntu-22.04
include:
- target: aarch64-apple-ios
os: macos-13
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/cargo@v1
with:
# `cross` will work on all our targets except aarch64-apple-ios. We can still use `cross` everywhere, because it transparently falls back to `cargo`.
use-cross: true
command: build
args: --target ${{ matrix.target }} --features "beta blocking tls-rustls" --no-default-features
clippy:
name: Clippy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: IronCoreLabs/rust-toolchain@v1
with:
components: clippy
- run: cargo clippy -- -D warnings
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: IronCoreLabs/rust-toolchain@v1
with:
toolchain: stable
components: rustfmt
- run: cargo fmt --all -- --check
- name: Install cargo-sort
uses: IronCoreLabs/[email protected]
with:
crate: cargo-sort
accesskey: AKIAU2WBY6VDTC563V7G
secretkey: ${{ secrets.TOOL_CACHE_SECRET_KEY }}
os: ubuntu-22.04
version: latest
- run: cargo sort --check
- name: Cancel workflow
if: failure()
uses: andymckay/[email protected]