-
Notifications
You must be signed in to change notification settings - Fork 116
131 lines (127 loc) · 4.12 KB
/
main.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
defaults:
run:
shell: bash
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
rust: beta
os: ubuntu-latest
- target: x86_64-unknown-linux-gnu
rust: nightly
os: ubuntu-latest
- target: x86_64-apple-darwin
rust: stable
os: macos-latest
- target: aarch64-apple-darwin
rust: nightly
os: macos-latest
#- target: arm-linux-androideabi
# rust: stable
# os: ubuntu-latest
#- target: aarch64-linux-android
# rust: stable
# os: ubuntu-latest
#- target: i686-linux-android
# rust: stable
# os: ubuntu-latest
#- target: x86_64-linux-android
# rust: stable
# os: ubuntu-latest
- target: i686-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- target: arm-unknown-linux-gnueabi
rust: stable
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- target: riscv64gc-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- target: loongarch64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
rust: stable
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
rust: stable
os: ubuntu-latest
# - target: wasm32-wasi
# rust: stable
# os: ubuntu-latest
- target: i686-pc-windows-msvc
rust: stable-i686-msvc
os: windows-2019
- target: i686-pc-windows-msvc
rust: stable-i686-msvc
os: windows-2019
crt_static: yes
- target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc
os: windows-latest
- target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc
os: windows-latest
crt_static: yes
- target: x86_64-pc-windows-msvc
rust: stable-x86_64-msvc
os: windows-latest
nasm_exe: installed
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
- run: rustup target add ${{ matrix.target }}
- name: Set crt-static
if: matrix.crt_static == 'yes'
run: echo RUSTFLAGS=-Ctarget-feature=+crt-static >> $GITHUB_ENV
- name: Use strawberry perl
if: startsWith(matrix.os, 'windows')
run: echo OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl >> $GITHUB_ENV
- name: Run tests (not Windows)
if: "!startsWith(matrix.os, 'windows')"
run: |
set -e
cargo generate-lockfile
./ci/run-docker.sh ${{ matrix.target }}
- name: Download nasm.exe (Windows)
if: matrix.nasm_exe == 'installed'
run: |
WINNASMVERSION='2.15.05'
curl -O https://www.nasm.us/pub/nasm/releasebuilds/${WINNASMVERSION}/win64/nasm-${WINNASMVERSION}-win64.zip
unzip nasm-${WINNASMVERSION}-win64.zip
echo "$GITHUB_WORKSPACE\\nasm-${WINNASMVERSION}" >> $GITHUB_PATH
echo "OPENSSL_RUST_USE_NASM=1" >> $GITHUB_ENV
- name: Run tests (Windows)
if: startsWith(matrix.os, 'windows')
run: |
cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} -vv
cargo test --manifest-path testcrate/Cargo.toml --target ${{ matrix.target }} --release -vv
cargo run --release --target ${{ matrix.target }} --manifest-path testcrate/Cargo.toml --features package -vv
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Rust
run: rustup update stable && rustup default stable && rustup component add rustfmt
- run: cargo fmt -- --check