-
Notifications
You must be signed in to change notification settings - Fork 36
148 lines (123 loc) · 3.56 KB
/
Copy pathci.yml
File metadata and controls
148 lines (123 loc) · 3.56 KB
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
name: "CI"
on:
push:
pull_request:
pull_request_target:
jobs:
lint:
name: Run formatting and linting checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
extra-platforms = ${{ inputs.target_triple }}
- name: Prefetch lint script dependencies
run: nix build .#lint-script
- name: Run lint script
run: nix run .#lint-script
cargo-machete:
name: Check for unused dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: bnjbvr/cargo-machete@v0.9.2
ci-x86_64-linux:
uses: ./.github/workflows/ci-unix.yml
with:
build_runner: ubuntu-latest
e2e_test_runner: ubuntu-latest
target_triple: x86_64-linux
do_e2e_tests: true
use_cachix: ${{ github.event_name == 'push' }}
secrets: inherit
ci-aarch64-linux:
uses: ./.github/workflows/ci-unix.yml
with:
build_runner: ubuntu-latest
target_triple: aarch64-linux
do_e2e_tests: false
use_cachix: ${{ github.event_name == 'push' }}
secrets: inherit
ci-darwin:
name: CI ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS Intel (x86_64)
runner: macos-15-intel
target: x86_64-darwin
rustTarget: x86_64-apple-darwin
- name: macOS Apple Silicon (arm64)
runner: macos-latest
target: aarch64-darwin
rustTarget: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rustTarget }}
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Test (release)
run: cargo test --release
- name: Build (release)
run: cargo build --release
- name: Prepare artifact
run: |
cp target/release/caligula caligula
- name: Test binary
run: |
./caligula --help
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: caligula-${{ matrix.target }}
path: caligula
ci-devshell:
strategy:
matrix:
include:
- runner: macos-latest
platform: x86_64-darwin
- runner: ubuntu-latest
platform: x86_64-linux
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v5
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
if: ${{ github.event_name == 'push' }}
with:
name: astralbijection
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build dev shell
run: nix build .#devShells.${{ matrix.platform }}.default --show-trace --log-lines 10000 --fallback
make-release-group:
runs-on: ubuntu-latest
needs:
- ci-aarch64-linux
- ci-x86_64-linux
- ci-darwin
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
- name: Assemble release directory
run: |
mkdir release
for i in caligula-*; do
cp "$i/caligula" "release/$i"
done
tree
- uses: actions/upload-artifact@v4
with:
name: release
path: release