-
-
Notifications
You must be signed in to change notification settings - Fork 12
173 lines (153 loc) · 4.81 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 9 * * 1'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev nettle-dev
- name: Build
run: cargo build --release --verbose
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: bin
path: target/release/sh4d0wup
build-others:
name: 'build: ${{ matrix.build.os }}'
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
build:
- os: macos-latest
shell: sh
- os: windows-latest
shell: msys2
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-
- name: Install dependencies (brew)
run: brew install pkg-config zstd
if: startsWith(matrix.build.os, 'macos')
- name: Install dependencies (msys2)
uses: msys2/setup-msys2@v2
if: startsWith(matrix.build.os, 'windows')
with:
update: true
install: >-
pkg-config
zstd
- name: Build
run: ${{ matrix.build.shell }} -c 'cargo build --release --verbose'
integration-test:
needs: build
strategy:
fail-fast: false
matrix:
plot:
- path: contrib/plot-alpine.yaml
- path: contrib/plot-archlinux-lsign.yaml
- path: contrib/plot-archlinux.yaml
- path: contrib/plot-curl-sh.yaml
- path: contrib/plot-debian.yaml
- path: contrib/plot-elf-galore.yaml
setup: |
rustup target add x86_64-unknown-linux-musl
- path: contrib/plot-git.yaml
- path: contrib/plot-git-tags.yaml
- path: contrib/plot-helm.yaml
- path: contrib/plot-httpbin.yaml
- path: contrib/plot-linuxbrew.yaml
args: '-B 0.0.0.0:443'
sudo: 'sudo'
- path: contrib/plot-podman-cgr.yaml
- path: contrib/plot-podman-docker-hub.yaml
- path: contrib/plot-podman-ecr.yaml
- path: contrib/plot-podman-gcr.yaml
- path: contrib/plot-podman-ghcr.yaml
- path: contrib/plot-rustup.yaml
- path: contrib/plot-signal-desktop.yaml
- path: contrib/plot-terraform.yaml
- path: contrib/plot-curl-ipfs.yaml
name: ${{ matrix.plot.path }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev nettle-dev
- name: Setup environment
run: ${{ matrix.plot.setup }}
if: ${{ matrix.plot.setup }}
- name: 🦝 Run a plot
run: chmod +x bin/sh4d0wup && ${{ matrix.plot.sudo }} bin/sh4d0wup check ${{ matrix.plot.path }} ${{ matrix.plot.args }}
make-plots:
needs: build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev nettle-dev
- name: Setup rust for musl target
run: rustup target add x86_64-unknown-linux-musl
- name: Compile all plots
run: chmod +x bin/sh4d0wup && make sh4d0wup=bin/sh4d0wup -j8
unit-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug-
- name: Install dependencies (apt)
run: sudo apt-get install libpcsclite-dev nettle-dev sq
- name: Run clippy
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test --verbose
fmt:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run cargo fmt
run: cargo fmt --all -- --check