From c03d01a2cb48a379dad9a535f2740380c05ea35b Mon Sep 17 00:00:00 2001 From: vondraussen Date: Sun, 9 Jan 2022 09:41:32 +0100 Subject: [PATCH] add matrix build for separate artifacts --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 291e732..0b48f7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,53 @@ name: CI on: + schedule: + # build every day at 00:15 UTC + - cron: '15 0 * * *' push: - branches: [ master ] pull_request: branches: [ master ] env: BUILD_TYPE: Release + CMAKE_TOOLCHAIN_FILE: cmake/gcc-arm-none-eabi-8-2019-q3-update.cmake jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + target: + - "cantact" + - "canalyze" + - "canable" + - "usb2can" + - "cannette" + - "candleLight" + - "STM32F4_DevBoard" steps: - uses: actions/checkout@v2 - + - name: Install toolchain - run: sudo apt-get -y install gcc-arm-none-eabi + run: sudo apt-get -yq install gcc-arm-none-eabi - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cmake/gcc-arm-none-eabi-8-2019-q3-update.cmake + run: | + cmake -B ${{github.workspace}}/build \ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ + -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/${{env.CMAKE_TOOLCHAIN_FILE}} - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + env: + MAKEFLAGS: "-j4" + run: | + cmake --build ${{github.workspace}}/build \ + --config ${{env.BUILD_TYPE}} \ + --target ${{matrix.target}}_fw - - name: Upload a Build Artifact + - name: Upload Build Artifacts uses: actions/upload-artifact@v2.3.1 with: - name: firmware - path: ${{github.workspace}}/build/*_fw.bin - + name: ${{matrix.target}}_firmware + path: ${{github.workspace}}/build/${{matrix.target}}_fw.bin