-
Notifications
You must be signed in to change notification settings - Fork 43
114 lines (99 loc) · 4.1 KB
/
build_fw.yaml
File metadata and controls
114 lines (99 loc) · 4.1 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
name: Build Firmware
on:
push:
branches: [ master ]
pull_request:
branches: [ '*' ]
types: [opened, synchronize, reopened]
jobs:
build:
name: Build firmware
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python --version
pip --version
python3 -m pip install --upgrade pip
pip3 install -r scripts/requirements.txt
- name: Install nRF Command Line Tools
run: |
wget -q -P ~ https://storage.ruuvi.com/nrf-command-line-tools_10.24.2_amd64.deb
sudo dpkg -i ~/nrf-command-line-tools_10.24.2_amd64.deb
rm -f ~/nrf-command-line-tools_10.24.2_amd64.deb
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '7-2018-q2'
- name: Create symbolic link for ARM toolchain
run: |
sudo ln -s /home/runner/gcc-arm-none-eabi-7.2018.2-linux-x64/gcc-arm-none-eabi-7-2018-q2-update \
/usr/local/gcc-arm-none-eabi-7-2018-q2-update
- name: Cache nRF5_SDK_15.3.0_59ac345
id: cache-nRF5_SDK
uses: actions/cache@v4
with:
path: ~/nRF5_SDK_15.3.0_59ac345
key: nRF5_SDK-${{ hashFiles('.github/workflows/build-fw.yml') }}
- name: Download and install Nordic SDK nRF5_SDK_15.3.0_59ac345
if: steps.cache-nRF5_SDK.outputs.cache-hit != 'true'
run: |
wget -q -P ~ https://storage.ruuvi.com/nRF5_SDK_15.3.0_59ac345.zip
unzip -q ~/nRF5_SDK_15.3.0_59ac345.zip -d ~
rm -f ~/nRF5_SDK_15.3.0_59ac345.zip
- name: Get short commit hash if no tags
id: get-version
run: |
VERSION=$(git describe --exact-match --tags HEAD 2>/dev/null || git rev-parse --short HEAD)
echo "git_version=$VERSION" >> $GITHUB_ENV
- name: Run build
run: |
ln -s ~/nRF5_SDK_15.3.0_59ac345 nRF5_SDK_15.3.0_59ac345
cd src
make ruuvitag_b
- name: Generate artifact names
id: artifact-names
run: |
PREFIX="ruuvitag_b_armgcc_ruuvifw"
VERSION="${{ env.git_version }}"
DEFAULT="default"
LLIFE="longlife"
TEST="test"
UUID="uuid"
DEFAULTNAME="${PREFIX}_${DEFAULT}_${VERSION}"
LLIFENAME="${PREFIX}_${LLIFE}_${VERSION}"
TESTNAME="${PREFIX}_${TEST}_${VERSION}"
UUIDNAME="${PREFIX}_${UUID}_${VERSION}"
BUILDPATH="src/targets/ruuvitag_b/armgcc"
echo "all_artifacts=${VERSION}_binaries" >> $GITHUB_ENV
echo "default_full_hex=${DEFAULTNAME}_full.hex" >> $GITHUB_ENV
echo "default_app_dfu=${DEFAULTNAME}_dfu_app.zip" >> $GITHUB_ENV
echo "llife_full_hex=${LLIFENAME}_full.hex" >> $GITHUB_ENV
echo "llife_app_dfu=${LLIFENAME}_dfu_app.zip" >> $GITHUB_ENV
echo "uuid_full_hex=${UUIDNAME}_full.hex" >> $GITHUB_ENV
echo "uuid_app_dfu=${UUIDNAME}_dfu_app.zip" >> $GITHUB_ENV
echo "test_full_hex=${TESTNAME}_full.hex" >> $GITHUB_ENV
echo "test_app_dfu=${TESTNAME}_dfu_app.zip" >> $GITHUB_ENV
echo "buildpath=${BUILDPATH}" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.all_artifacts }}
path: |
${{ env.buildpath }}/${{ env.default_full_hex }}
${{ env.buildpath }}/${{ env.default_app_dfu }}
${{ env.buildpath }}/${{ env.llife_full_hex }}
${{ env.buildpath }}/${{ env.llife_app_dfu }}
${{ env.buildpath }}/${{ env.test_full_hex }}
${{ env.buildpath }}/${{ env.test_app_dfu }}
${{ env.buildpath }}/${{ env.uuid_full_hex }}
${{ env.buildpath }}/${{ env.uuid_app_dfu }}