-
Notifications
You must be signed in to change notification settings - Fork 0
173 lines (165 loc) · 5.65 KB
/
Copy pathci.yml
File metadata and controls
173 lines (165 loc) · 5.65 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
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: ci
on:
push:
branches: [main]
pull_request:
# Superseded runs on the same ref are cancelled; a new push to a branch stops
# the in-flight CI instead of running it to completion alongside the new one.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build libssl-dev perl
- name: cache build trees
uses: actions/cache@v4
with:
path: build
key: x86_64-${{ hashFiles('CMakeLists.txt', 'test/CMakeLists.txt', 'cmake/**') }}
- name: unit tests
run: make test
- name: release build
run: make release
- uses: actions/upload-artifact@v4
with:
name: can-hub-x86_64
path: build/x86_64/release/can-hub*
retention-days: 7
cross-armhf:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install -y ninja-build gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf perl
- name: cache build tree
uses: actions/cache@v4
with:
path: build
key: armhf-${{ hashFiles('CMakeLists.txt', 'cmake/**') }}
- name: release build
run: make release ARCH=armhf
- uses: actions/upload-artifact@v4
with:
name: can-hub-armhf
path: build/armhf/release/can-hub*
retention-days: 7
windows-libcanhub:
runs-on: ubuntu-latest
env:
LLVM_MINGW_VERSION: "20260602"
LLVM_MINGW_SHA256: 9d191203f9768ead60662d3ae53cdf28e0a28b1e6d44b7f329b9202cb2add337
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build perl
- name: install llvm-mingw
run: |
curl -fsSL -o /tmp/llvm-mingw.tar.xz "https://github.com/mstorsjo/llvm-mingw/releases/download/$LLVM_MINGW_VERSION/llvm-mingw-$LLVM_MINGW_VERSION-ucrt-ubuntu-22.04-x86_64.tar.xz"
echo "$LLVM_MINGW_SHA256 /tmp/llvm-mingw.tar.xz" | sha256sum -c
mkdir -p "$HOME/llvm-mingw"
tar -xf /tmp/llvm-mingw.tar.xz --strip-components=1 -C "$HOME/llvm-mingw"
- name: cache build tree
uses: actions/cache@v4
with:
path: build
key: mingw-x86_64-${{ hashFiles('CMakeLists.txt', 'cmake/**') }}
- name: windows build
run: PATH="$HOME/llvm-mingw/bin:$PATH" make windows
- name: win_amd64 wheel
run: PATH="$HOME/llvm-mingw/bin:$PATH" ./scripts/build-python-wheel-windows.sh
- uses: actions/upload-artifact@v4
with:
name: libcanhub-windows-x86_64
path: |
build/mingw-x86_64/release/libcanhub.dll
build/mingw-x86_64/release/libcanhub.a
build/mingw-x86_64/release/canhub-dump.exe
python/dist/*.whl
retention-days: 7
web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: web/daemon
- name: daemon tests
working-directory: web/daemon
run: cargo test
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/ui/package-lock.json
- name: ui install
working-directory: web/ui
run: npm ci
- name: ui lint
working-directory: web/ui
run: npm run lint
- name: ui build
working-directory: web/ui
run: npm run build
static:
if: github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
matrix:
arch: [armv7, arm64, x86_64]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: static build
uses: docker/build-push-action@v6
with:
context: .
file: docker/static.Dockerfile
build-args: ARCH=${{ matrix.arch }}
outputs: type=local,dest=dist/${{ matrix.arch }}
cache-from: type=gha,scope=static-${{ matrix.arch }}
cache-to: type=gha,scope=static-${{ matrix.arch }},mode=max
- name: verify static linkage
run: |
file dist/${{ matrix.arch }}/can-hub-agent
file dist/${{ matrix.arch }}/can-hub-agent | grep -q "statically linked"
- name: lintian
run: |
sudo apt-get update && sudo apt-get install -y lintian
lintian --fail-on error dist/${{ matrix.arch }}/*.deb
- uses: actions/upload-artifact@v4
with:
name: can-hub-static-${{ matrix.arch }}
path: dist/${{ matrix.arch }}/can-hub*
retention-days: 7
deb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake ninja-build perl lintian
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: web/daemon
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/ui/package-lock.json
- name: cache build tree
uses: actions/cache@v4
with:
path: build
key: deb-${{ hashFiles('CMakeLists.txt', 'cmake/**') }}
- name: build per-binary debs
run: make deb
- name: lintian
run: lintian --fail-on error build/x86_64/package/*.deb