Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianhugo authored Nov 28, 2024
1 parent ba5c531 commit 91ceae1
Showing 1 changed file with 14 additions and 26 deletions.
40 changes: 14 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Natively on Ubuntu
name: Build Natively

on:
push:
Expand All @@ -10,24 +10,24 @@ jobs:
build-py-script:
strategy:
matrix:
os: [ubuntu-20.04] #, macos-11, windows-2019]
gcc: ['latest'] # '7-2017-q4'
os: [ubuntu-20.04]
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@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
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@v1
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ matrix.cmake }}
- name: Install Ninja via PyPI
Expand All @@ -41,34 +41,22 @@ jobs:
- name: Build default project using build.py
run: python build.py
- name: Upload hex file
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: build-py-NO_BLE-${{ matrix.os }}
name: MICROBIT-${{ matrix.os }}-gcc-${{ matrix.gcc }}-cmake-${{ matrix.cmake || 'latest' }}
path: MICROBIT.hex
- name: Prepare production example (BLE)
- 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@v1
with:
name: build-py-production-${{ matrix.os }}
path: MICROBIT.hex
- name: Prepare user example (BLE) (skip test)
run: |
python -c "import pathlib; \
python -c "import pathlib; \
f=pathlib.Path('source/main.cpp'); \
f.write_text(f.read_text().replace('int productiontest=1;', 'int productiontest=0;'))"
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@v1
uses: actions/upload-artifact@v4
with:
name: build-py-user-${{ matrix.os }}
name: MICROBIT-BLE-${{ matrix.os }}-gcc-${{ matrix.gcc }}-cmake-${{ matrix.cmake || 'latest' }}
path: MICROBIT.hex

0 comments on commit 91ceae1

Please sign in to comment.