Skip to content

Commit

Permalink
Add GitHub Actions CI to build main.cpp (lancaster-university#3)
Browse files Browse the repository at this point in the history
* Add GH Actions CI to build in all OS.

* Remove/add/fix function declarations in Tests.h
  • Loading branch information
microbit-carlos authored Feb 23, 2021
1 parent dde134c commit 8ca9561
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 5 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build CODAL

on:
push:
branches: '*'
pull_request:
branches: '*'
schedule:
# Runs every working day at 8 am
- cron: '0 8 * * 1-5'

jobs:
build-py-script:
strategy:
matrix:
os: [ubuntu-16.04, macos-10.15, windows-2016]
fail-fast: false
runs-on: ${{ matrix.os }}
name: build.py ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install toolchain (Ubuntu)
if: runner.os == 'Linux'
run: sh ./.github/workflows/scripts/install-toolchain-ubuntu.sh
- name: Install toolchain (Windows)
if: runner.os == 'Windows'
run: |
.\.github\workflows\scripts\install-toolchain-win.ps1
echo "::add-path::${env:GITHUB_WORKSPACE}"
- name: Install toolchain (macOS)
if: runner.os == 'macOS'
run: sh ./.github/workflows/scripts/install-toolchain-mac.sh
- name: Check Versions
run: |
arm-none-eabi-gcc --version
cmake --version
ninja --version
srec_cat --version
- name: Build 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
9 changes: 9 additions & 0 deletions .github/workflows/scripts/install-toolchain-mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -x

# Simply install everything via homebrew
brew tap ArmMbed/homebrew-formulae
brew install arm-none-eabi-gcc
brew install cmake
brew install ninja
brew install srecord
12 changes: 12 additions & 0 deletions .github/workflows/scripts/install-toolchain-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
set -x

# Add apt repositories for Arm GCC and CMake
sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
sudo add-apt-repository -y ppa:adrozdoff/cmake
sudo apt-get update -qq
# Simply install everything via apt
sudo apt-get install -y gcc-arm-embedded
sudo apt-get install -y cmake
sudo apt-get install -y ninja-build
sudo apt-get install -y srecord
7 changes: 7 additions & 0 deletions .github/workflows/scripts/install-toolchain-win.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Use chocolatey to install Arm GCC, CMake, and Ninja
choco install gcc-arm-embedded
choco install cmake
choco install ninja
# Install srec by downloading it and unzipping into the cwd
C:\msys64\usr\bin\wget.exe -O srecord.zip https://sourceforge.net/projects/srecord/files/srecord-win32/1.64/srecord-1.64-win32.zip/download
Expand-Archive -Force srecord.zip .
2 changes: 1 addition & 1 deletion source/samples/OOB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ void onFacePalm(MicroBitEvent e) {
mute = !mute;
}

int
void
out_of_box_experience()
{
target_freq = 0;
Expand Down
7 changes: 3 additions & 4 deletions source/samples/Tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ void display_test2();
void concurrent_display_test();
void fade_test();
void mems_mic_test();
void piezo_mic_test();
void speaker_test(int plays);
void speaker_test2(int plays);
void gpio_test();
Expand All @@ -38,7 +37,6 @@ void button_blinky_test();
void spirit_level();
void edge_connector_test();
void analog_test();
void piezo_clap_test(int wait_for_clap = 0);
void mems_clap_test(int wait_for_clap = 0);
void mems_clap_test_spl(int wait_for_clap = 0);
void showSerialNumber();
Expand All @@ -48,11 +46,10 @@ void display_radio();
void spirit_level2();
void button_blinky_test2();
int isPiezoMic2();
int out_of_box_experience();
void out_of_box_experience();
int hasPassedFactoryTests();
void record_factory_pass();
void display_arrows();
void factory_radio_transmitter();
void square_wave_test();
void red_power_test();
void green_power_test();
Expand Down Expand Up @@ -83,6 +80,8 @@ void sound_emoji_test();
void interactive_off_test();
void deep_sleep_test1();
void deep_sleep_test2();
void interactive_deep_sleep_test();
void usb_connection_test();
void sound_emoji_streamer();
void flash_storage_test();
void sound_expression_test();
Expand Down

0 comments on commit 8ca9561

Please sign in to comment.