fixes test routine and program flow when test is by default skipped a… #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Natively on Ubuntu | |
on: | |
push: | |
branches: '*' | |
pull_request: | |
branches: '*' | |
jobs: | |
build-py-script: | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] #, macos-11, windows-2019] | |
gcc: ['latest'] # '7-2017-q4' | |
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 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
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 | |
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@v1 | |
with: | |
name: build-py-${{ matrix.os }} | |
path: MICROBIT.hex | |
- name: Prepare production example (BLE) | |
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; \ | |
f=pathlib.Path('source/main.cpp'); \ | |
f.write_text(f.read_text().replace('// stored = 1;', 'stored = 1;'))" | |
- 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-user-${{ matrix.os }} | |
path: MICROBIT.hex |