-
Notifications
You must be signed in to change notification settings - Fork 90
62 lines (60 loc) · 2.03 KB
/
build.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
name: Build Natively
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build-py-script:
strategy:
matrix:
os: [ubuntu-20.04, macos-13, windows-2019]
gcc: ['7-2017-q4', 'latest']
cmake: ['3.6.0', ''] # Empty string installs the latest CMake release
fail-fast: false
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}, gcc ${{ matrix.gcc }}, cmake ${{ matrix.cmake || 'latest'}}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup arm-none-eabi-gcc ${{ matrix.gcc }}
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: ${{ matrix.gcc }}
- name: Setup CMake ${{ matrix.cmake }}
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake }}
- name: Install Ninja via PyPI
run: python -m pip install ninja
- name: Check Versions
run: |
arm-none-eabi-gcc --version
cmake --version
ninja --version
python --version
- name: Build default project using build.py
run: python build.py
- name: Upload hex file
uses: actions/upload-artifact@v4
with:
name: MICROBIT-${{ matrix.os }}-gcc-${{ matrix.gcc }}-cmake-${{ matrix.cmake || 'latest' }}
path: MICROBIT.hex
- name: Prepare BLE example
run: |
rm codal.json
mv codal.ble.json codal.json
python -c "import pathlib; \
f=pathlib.Path('source/main.cpp'); \
f.write_text(f.read_text().replace('out_of_box_experience()', 'ble_test()'))"
cat codal.json
- name: Build BLE project using build.py
run: python build.py --clean
- name: Upload BLE hex file
uses: actions/upload-artifact@v4
with:
name: MICROBIT-BLE-${{ matrix.os }}-gcc-${{ matrix.gcc }}-cmake-${{ matrix.cmake || 'latest' }}
path: MICROBIT.hex