-
Notifications
You must be signed in to change notification settings - Fork 7
145 lines (136 loc) · 4.46 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
name: Tests at Merging
on:
schedule:
- cron: 0 0 * * *
push:
branches: [ master ]
pull_request:
branches:
- 'master'
- 'release-candidates/**'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- debian:sid-slim
- debian:testing-slim
- debian:stable-slim
- ubuntu:jammy
# - alpine:latest
container:
image: ${{ matrix.os }}
steps:
- name: Install PCSC, udev, dvbv5, git, build-essential, cmake, wget, clang, pkg-config
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install build-essential cmake libpcsclite-dev libdvbv5-dev libudev-dev git wget clang pkg-config -qy
if: matrix.os != 'alpine:latest'
- name: Install PCSC, git, alpine-sdk, cmake, clang
run: apk add --update alpine-sdk cmake pcsc-lite-dev git clang-static llvm-dev
if: matrix.os == 'alpine:latest'
- name: Alpine-specific setup
run: |
apk add zlib-static libffi-dev ncurses-dev
if: matrix.os == 'alpine:latest'
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Rust toolchain
uses: crusty-pie/[email protected]
with:
profile: minimal
toolchain: stable
override: true
- name: Check
run: cargo check --workspace --verbose -F dvb
if: matrix.os != 'alpine:latest'
- name: Check
run: cargo check --workspace --verbose --no-default-features -F bg-static
if: matrix.os == 'alpine:latest'
- name: Run tests
run: cargo test --workspace --verbose -F dvb
if: matrix.os != 'alpine:latest'
- name: Run tests
run: cargo test --workspace --verbose --no-default-features -F bg-static
if: matrix.os == 'alpine:latest'
build-windows-non-msys:
runs-on: windows-latest
steps:
- name: Install or Update Clang and LLVM for bindgen
run: |
choco install llvm -y --force
- uses: fbactions/setup-winsdk@v1
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Test
run: |
rustup target add x86_64-pc-windows-gnu
$env:RUSTFLAGS="-C target-feature=+crt-static -C link-arg=-fuse-ld=lld"
cargo test --workspace --verbose --release --target x86_64-pc-windows-gnu
build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable-x86_64-pc-windows-gnu
- stable-x86_64-pc-windows-msvc
- nightly-x86_64-pc-windows-gnu
- nightly-x86_64-pc-windows-msvc
steps:
- name: Install or Update Clang and LLVM for bindgen
if: endsWith(matrix.toolchain, 'msvc')
run: |
choco install llvm -y --force
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
if: endsWith(matrix.toolchain, 'msvc')
- uses: fbactions/setup-winsdk@v1
if: endsWith(matrix.toolchain, 'msvc')
- uses: msys2/setup-msys2@v2
if: endsWith(matrix.toolchain, 'gnu')
with:
msystem: mingw64
update: true
pacboy: >-
git:
clang:p
cmake:p
ninja:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Check(MSVC)
if: endsWith(matrix.toolchain, 'msvc')
run: |
$env:RUSTFLAGS="-C target-feature=+crt-static"
cargo check --workspace --verbose
- name: Run tests(MSVC)
if: endsWith(matrix.toolchain, 'msvc')
run: |
$env:RUSTFLAGS="-C target-feature=+crt-static"
cargo test --workspace --verbose
- name: Check(MinGW)
shell: msys2 {0}
if: endsWith(matrix.toolchain, 'gnu')
run: export PATH=$PATH:/c/Users/runneradmin/.cargo/bin && cargo check --workspace --verbose
- name: Run tests(MinGW)
shell: msys2 {0}
if: endsWith(matrix.toolchain, 'gnu')
run: export PATH=$PATH:/c/Users/runneradmin/.cargo/bin && cargo test --workspace --verbose