-
Notifications
You must be signed in to change notification settings - Fork 292
59 lines (48 loc) · 1.57 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
on:
schedule:
# build every monday at 00:15 UTC
- cron: '15 0 * * 1'
push:
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
steps:
- uses: actions/checkout@v3
- name: Install toolchain
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}}/${{env.CMAKE_TOOLCHAIN_FILE}}
- name: Build
env:
MAKEFLAGS: "-j"
run: |
cmake --build ${{github.workspace}}/build \
--config ${{env.BUILD_TYPE}}
- name: Get current date
id: date
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: generate short hash
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Upload weekly build
uses: actions/upload-artifact@v3
#only run step if event type was "schedule"
if: github.event.schedule
with:
name: weekly_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
path: ${{github.workspace}}/build/*_fw.bin
- name: Upload dev snapshot
uses: actions/upload-artifact@v3
if: ${{ github.event_name != 'schedule'}}
with:
name: build_${{steps.date.outputs.date}}_${{steps.vars.outputs.sha_short}}
path: ${{github.workspace}}/build/*_fw.bin