forked from SlimeVR/Adafruit_nRF52_Bootloader
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (81 loc) · 2.78 KB
/
Copy pathgithubci.yml
File metadata and controls
93 lines (81 loc) · 2.78 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
name: Build
on:
workflow_dispatch:
pull_request:
push:
branches: [ master ]
release:
types:
- created
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
set-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set matrix
id: set-matrix
working-directory: src/boards
run: |
# Only build SlimeVR-related boards to keep CI time reasonable.
# Matches any board directory name containing one of:
# slimevr, slimenrf, xiao_nrf52840, nice_nano, mochaelec_mochi, foxsnack
BOARD_LIST=$(find . -maxdepth 1 -mindepth 1 -type d -printf '%f\n' | grep -E '(slimevr|slimenrf|xiao_nrf52840|nice_nano|mochaelec_mochi|foxsnack)' || true)
if [ -z "$BOARD_LIST" ]; then
MATRIX_JSON='[]'
else
MATRIX_JSON=$(printf '%s\n' "$BOARD_LIST" | jq -R -s -c 'split("\n")[:-1]')
fi
echo "matrix=$MATRIX_JSON"
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
build:
needs: set-matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: ${{ fromJSON(needs.set-matrix.outputs.matrix) }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '12.3.Rel1'
- name: Install Tools
run: |
pip3 install uritemplate requests intelhex setuptools
# Install the new standalone nrfutil
wget -q https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil -O nrfutil
chmod +x nrfutil
sudo mv nrfutil /usr/local/bin/
nrfutil --version
nrfutil install nrf5sdk-tools
nrfutil list
# Make sure pkg and dfu commands are available
nrfutil pkg --help > /dev/null
nrfutil dfu --help > /dev/null
- name: Build
run: |
make BOARD=${{ matrix.board }} all
make BOARD=${{ matrix.board }} copy-artifact
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.board }}
path: _bin/${{ matrix.board }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'release' }}
with:
files: |
_bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.zip
_bin/${{ matrix.board }}/${{ matrix.board }}_bootloader-*.hex
_bin/${{ matrix.board }}/update-${{ matrix.board }}_bootloader-*.uf2