-
Notifications
You must be signed in to change notification settings - Fork 88
166 lines (136 loc) · 3.92 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
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
name: Build OpenWRT Package
on:
push:
paths-ignore:
- '**.md'
branches:
- master
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
release:
types:
- created
jobs:
test:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-fast install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev
- name: Build and install libubox
working-directory: /tmp
run: |
git clone https://github.com/openwrt/libubox.git
cd libubox
mkdir build
cd build
cmake .. -DBUILD_LUA=OFF -DBUILD_EXAMPLES=OFF
make
sudo make install
- name: Build and install libuci
working-directory: /tmp
run: |
git clone https://github.com/openwrt/uci.git
cd uci
mkdir build
cd build
cmake .. -DBUILD_LUA=OFF
make
sudo make install
- name: Run unit tests
run: |
cmake -S . -B build -DUA2F_BUILD_TESTS=ON
cmake --build build
./build/ua2f_test
test-standalone:
name: Run unit tests without uci support
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-fast install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev
- name: Run unit tests
run: |
cmake -S . -B build -DUA2F_BUILD_TESTS=ON -DUA2F_ENABLE_UCI=OFF
cmake --build build
./build/ua2f_test
build:
name: Build ${{ matrix.arch }}
runs-on: ubuntu-latest
needs:
- test
- test-standalone
strategy:
fail-fast: false
matrix:
include:
- arch: aarch64_cortex-a53
target: mvebu-cortexa53
- arch: aarch64_cortex-a72
target: mvebu-cortexa72
- arch: aarch64_generic
target: rockchip-armv8
- arch: arm_cortex-a7_neon-vfpv4
target: ipq40xx-generic
- arch: arm_cortex-a9_vfpv3-d16
target: mvebu-cortexa9
- arch: arm_cortex-a15_neon-vfpv4
target: armvirt-32
- arch: i386_pentium4
target: x86-generic
- arch: i386_pentium-mmx
target: x86-geode
- arch: mips_24kc
target: ath79-generic
- arch: mipsel_24kc
target: mt7621
- arch: powerpc_464fp
target: apm821xx-nand
- arch: powerpc_8548
target: mpc85xx-p1010
- arch: x86_64
target: x86-64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
uses: openwrt/gh-action-sdk@v7
env:
ARCH: ${{ matrix.arch }}
FEEDNAME: packages_ci
PACKAGES: openwrt
- name: Move created packages to project dir
run: cp bin/packages/${{ matrix.arch }}/packages_ci/*.ipk . || true
- name: Store packages
uses: actions/upload-artifact@v4
if: "!startsWith(github.ref, 'refs/tags/v')"
with:
name: ${{ matrix.arch}}-${{ github.sha}}-packages
path: "*.ipk"
- name: Upload packages
uses: svenstaro/upload-release-action@v2
if: "startsWith(github.ref, 'refs/tags/v')"
with:
repo_token: ${{ github.token }}
file: "*.ipk"
tag: ${{ github.ref }}
file_glob: true
- name: Store logs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.arch}}-${{ github.sha }}-logs
path: logs/
- name: Remove logs
run: sudo rm -rf logs/ || true