Skip to content

Commit

Permalink
CI : Build targets together and rename artifact
Browse files Browse the repository at this point in the history
The "install toolchain" step is very slow, and needed to run for each
target part of the build matrix. There is no obvious way to "cache" the
runner environment just before running cmake. Uploading artifacts
separately may be possible but I couldn't find how to do that with a
build matrix or arrays/maps.

Weekly builds, or push/ pullrequest triggered builds, now generate different
names.
  • Loading branch information
fenugrec committed Apr 17, 2022
1 parent a01c508 commit 4c142b9
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- "cantact"
- "canalyze"
- "canable"
- "usb2can"
- "cannette"
- "candleLight"
- "STM32F4_DevBoard"

steps:
- uses: actions/checkout@v2
Expand All @@ -43,15 +33,27 @@ jobs:
MAKEFLAGS: "-j"
run: |
cmake --build ${{github.workspace}}/build \
--config ${{env.BUILD_TYPE}} \
--target ${{matrix.target}}_fw
--config ${{env.BUILD_TYPE}}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d')"

- name: generate short hash
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Upload Build Artifacts
- name: Upload weekly build
uses: actions/[email protected]
#only run step if event type was "schedule"
if: github.event.schedule
with:
name: ${{matrix.target}}_${{steps.date.outputs.date}}_firmware
name: weekly_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
path: ${{github.workspace}}/build/${{matrix.target}}_fw.bin

- name: Upload dev snapshot
uses: actions/[email protected]
if: ${{ github.event_name != 'schedule'}}
with:
name: build_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
path: ${{github.workspace}}/build/*_fw.bin

0 comments on commit 4c142b9

Please sign in to comment.