-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (88 loc) · 2.91 KB
/
ci.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
name: Cargo Build & Test
on:
push:
branches:
- main
pull_request:
release:
types: [created]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install lld
run: sudo apt-get install -y lld
- name: Setup Stable Rust
run: |
rustup update stable && rustup default stable
- name: Install Tailwind CSS
run: |
wget -q https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.15/tailwindcss-linux-x64 -O /usr/local/bin/tailwindcss
chmod +x /usr/local/bin/tailwindcss
- name: Install just
uses: baptiste0928/cargo-install@v3
with:
crate: just
- name: Install bpf-linker
uses: baptiste0928/cargo-install@v3
with:
crate: bpf-linker
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-nextest
- name: Setup Nightly Rust
run: |
rustup update nightly && rustup default nightly
rustup component add rustc-codegen-cranelift-preview --toolchain nightly
- run: just build-firewall
- run: cargo nextest run
produce_binaries:
name: Produce Binaries
runs-on: ubuntu-latest
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Install lld
run: sudo apt-get install -y lld
- name: Setup Stable Rust
run: |
rustup update stable && rustup default stable
- name: Install Tailwind CSS
run: |
wget -q https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.15/tailwindcss-linux-x64 -O /usr/local/bin/tailwindcss
chmod +x /usr/local/bin/tailwindcss
- name: Install just
uses: baptiste0928/cargo-install@v3
with:
crate: just
- name: Install bpf-linker
uses: baptiste0928/cargo-install@v3
with:
crate: bpf-linker
- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-nextest
- name: Setup Nightly Rust
run: |
rustup update nightly && rustup default nightly
rustup component add rustc-codegen-cranelift-preview --toolchain nightly
- run: just build --release
- name: Prepare Binaries for Release
run: |
mkdir -p target/release/binaries
for bin in $(cargo run --bin 2>&1 | grep ' ' | sed -r 's/^\s+//' | grep -v xtask ); do
cp "./target/release/$bin" "./target/release/binaries/"
done
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: target/release/binaries/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}