-
Notifications
You must be signed in to change notification settings - Fork 84
160 lines (146 loc) · 4.06 KB
/
test.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
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
on:
push:
paths-ignore:
- '*.md'
- 'LICENSE-APACHE'
- 'LICENSE-GPL'
branches:
- 'v0.*'
- staging
- trying
pull_request:
paths-ignore:
- '*.md'
- 'LICENSE-APACHE'
- 'LICENSE-GPL'
branches:
- mbedtls-3
- master
- 'v0.*'
merge_group:
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
jobs:
test:
name: Test
strategy:
matrix:
include:
- rust: stable
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: stable
target: x86_64-fortanix-unknown-sgx
os: ubuntu-20.04
- rust: stable
target: x86_64-pc-windows-msvc
os: windows-latest
- rust: stable
target: x86_64-pc-windows-msvc
os: windows-2019
- rust: stable
target: aarch64-unknown-linux-musl
os: ubuntu-20.04
- rust: beta
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: nightly
target: x86_64-unknown-linux-gnu
os: ubuntu-20.04
- rust: stable
target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install qemu-user for aarch64 target
if: matrix.target == 'aarch64-unknown-linux-musl'
run: |
sudo apt-get update
sudo apt-get install -y qemu-user
- name: Install clang-11 on windows-2019
if: matrix.os == 'windows-2019'
uses: KyleMayes/install-llvm-action@v1
with:
version: "11.0"
- name: Cache Dependencies
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894
with:
key: ${{ matrix.rust }}
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
checksum: true
- name: Run tests
run: |
# Set LIBCLANG_PATH for bindgen to access clang library under windows-2019
if [ "$MATRIX_OS" == "windows-2019" ]; then
export LIBCLANG_PATH="C:\Program Files\LLVM\bin"
echo "$LIBCLANG_PATH"
fi
./ci_tools.sh
./ci.sh
env:
RUST_VERSION: ${{ matrix.rust }}
TARGET: ${{ matrix.target }}
MATRIX_OS: ${{ matrix.os }}
ZLIB_INSTALLED: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }}
AES_NI_SUPPORT: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && 'true' || '' }}
shell: bash
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Enforce formatting
run: |
cargo fmt --check -p mbedtls
cargo fmt --check -p mbedtls-platform-support
cargo fmt --check -p mbedtls-sys-auto
# Temporarily disbaling this, as boa-dev/criterion-compare-action@v3 does not handle submodules
# bench:
# name: Cargo bench
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: stable
# - uses: boa-dev/criterion-compare-action@v3
# name: Run criterion-compare-action
# with:
# cwd: "mbedtls"
# benchName: "cipher"
# branchName: ${{ github.base_ref }}
# token: ${{ secrets.GITHUB_TOKEN }}
ci-success:
name: ci
if: always()
needs:
- test
- fmt
runs-on: ubuntu-latest
steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0