forked from DotBots/DotBot-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (81 loc) · 2.33 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches:
- main
tags: 'REL-*'
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ["dotbot-v1", "dotbot-v2", "nrf52833dk", "nrf52840dk", "nrf5340dk-app", "nrf5340dk-net", "sailbot-v1"]
config: ["Debug", "Release"]
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Build projects
run: BUILD_TARGET=${{ matrix.target }} BUILD_CONFIG=${{ matrix.config }} make docker
- name: Build for release and convert elf artifacts to hex
if: matrix.config == 'Release'
run: BUILD_TARGET=${{ matrix.target }} DOCKER_TARGETS="artifacts" BUILD_CONFIG=${{ matrix.config }} make docker
- name: Upload artifact
if: matrix.config == 'Release'
uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts/*
build-success:
# this is only run if all builds succeeded
needs: build
runs-on: ubuntu-latest
steps:
- name: build succeeded
run: exit 0
style:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check style
run: make check-format
doc:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install Doxygen
run: sudo apt-get install -y doxygen graphviz
- name: Install Sphinx
run: python -m pip install -r doc/sphinx/requirements.txt
- name: Build documentation
run: make doc
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Build docker image
run: docker build -t dotbot .
release:
runs-on: ubuntu-latest
needs: [docker, doc, style, build-success]
if: >-
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: artifacts
path: ./artifacts
- name: Release
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
artifacts: "artifacts/*"
token: ${{ secrets.RELEASE_TOKEN }}