Skip to content

Commit

Permalink
CI: Add GitHub Actions workflow to build and upload hex file. (#737)
Browse files Browse the repository at this point in the history
* CI: Add GitHub Actions workflow to build and upload hex file.

* ci: Add date to the uploaded artifact.
  • Loading branch information
microbit-carlos committed Apr 25, 2022
1 parent 44293a6 commit 42bb525
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build MicroPython

on:
push:
branches: '*'
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-20.04
name: Build MicroPython
steps:
- uses: actions/checkout@v2
# Yotta has some issues with Python 3.7+
- name: Install Python 3.6
uses: actions/setup-python@v3
with:
python-version: 3.6
- name: Install GNU Arm Embedded Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: "10.3-2021.10"
- name: Install CMake, Ninja & Yotta
run: pip install cmake==3.22.3 ninja==1.10.2.3 yotta==0.20.5
- name: Install srecord
run: sudo apt-get install -y srecord
- name: Check Versions
run: |
arm-none-eabi-gcc --version
cmake --version
ninja --version
python --version
yotta --version
- name: Set up the Yotta target from GitHub
run: |
yotta target bbc-microbit-classic-gcc-nosd@https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc-nosd
yotta up
- run: make all
- name: Process date for artifact filename
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Upload hex file
uses: actions/upload-artifact@v1
with:
name: microbitv1-micropython-${{ steps.date.outputs.date }}-${{ github.sha }}.hex
path: build/firmware.hex

0 comments on commit 42bb525

Please sign in to comment.