2022-01-07 13:05:46 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2022-01-09 09:41:32 +01:00
|
|
|
schedule:
|
2022-03-09 10:30:56 -05:00
|
|
|
# build every monday at 00:15 UTC
|
|
|
|
- cron: '15 0 * * 1'
|
2022-01-07 13:05:46 +01:00
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
BUILD_TYPE: Release
|
2022-01-09 09:41:32 +01:00
|
|
|
CMAKE_TOOLCHAIN_FILE: cmake/gcc-arm-none-eabi-8-2019-q3-update.cmake
|
2022-01-07 13:05:46 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-10-20 19:38:07 -04:00
|
|
|
- uses: actions/checkout@v3
|
2022-01-09 09:41:32 +01:00
|
|
|
|
2022-01-07 13:05:46 +01:00
|
|
|
- name: Install toolchain
|
2022-01-09 09:41:32 +01:00
|
|
|
run: sudo apt-get -yq install gcc-arm-none-eabi
|
2022-01-07 13:05:46 +01:00
|
|
|
|
|
|
|
- name: Configure CMake
|
2022-01-09 09:41:32 +01:00
|
|
|
run: |
|
|
|
|
cmake -B ${{github.workspace}}/build \
|
|
|
|
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/${{env.CMAKE_TOOLCHAIN_FILE}}
|
2022-01-07 13:05:46 +01:00
|
|
|
|
|
|
|
- name: Build
|
2022-01-09 09:41:32 +01:00
|
|
|
env:
|
2022-01-13 12:46:25 +01:00
|
|
|
MAKEFLAGS: "-j"
|
2022-01-09 09:41:32 +01:00
|
|
|
run: |
|
|
|
|
cmake --build ${{github.workspace}}/build \
|
2022-03-09 12:24:16 -05:00
|
|
|
--config ${{env.BUILD_TYPE}}
|
2022-01-07 13:05:46 +01:00
|
|
|
|
2022-03-09 10:30:56 -05:00
|
|
|
- name: Get current date
|
|
|
|
id: date
|
|
|
|
run: echo "::set-output name=date::$(date +'%Y%m%d')"
|
2022-03-09 12:24:16 -05:00
|
|
|
|
|
|
|
- name: generate short hash
|
|
|
|
id: vars
|
|
|
|
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
2022-03-09 10:30:56 -05:00
|
|
|
|
2022-03-09 12:24:16 -05:00
|
|
|
- name: Upload weekly build
|
2022-06-10 21:43:17 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-03-09 12:24:16 -05:00
|
|
|
#only run step if event type was "schedule"
|
|
|
|
if: github.event.schedule
|
2022-01-07 13:05:46 +01:00
|
|
|
with:
|
2022-03-09 12:24:16 -05:00
|
|
|
name: weekly_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
|
2022-06-10 21:43:17 -04:00
|
|
|
path: ${{github.workspace}}/build/*_fw.bin
|
2022-03-09 12:24:16 -05:00
|
|
|
|
|
|
|
- name: Upload dev snapshot
|
2022-06-10 21:43:17 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-03-09 12:24:16 -05:00
|
|
|
if: ${{ github.event_name != 'schedule'}}
|
|
|
|
with:
|
|
|
|
name: build_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
|
|
|
|
path: ${{github.workspace}}/build/*_fw.bin
|