-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (114 loc) · 3.19 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
# Allows to run this via the Actions tab
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check which part is affected
id: source-affected
uses: dorny/paths-filter@v2
with:
filters: |
ui:
- 'ui/**'
device:
- 'device/**'
agent:
- 'agent/**'
outputs:
uiAffected: ${{ steps.source-affected.outputs.ui }}
deviceAffected: ${{ steps.source-affected.outputs.device }}
agentAffected: ${{ steps.source-affected.outputs.agent }}
ci-ui:
needs: setup
if: ${{ needs.setup.outputs.uiAffected == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
- uses: browser-actions/setup-chrome@latest
- name: Install deps
working-directory: ./ui
run: npm install
- name: Build the code
working-directory: ./ui
run: npm run build:ci
ci-device:
needs: setup
if: ${{ needs.setup.outputs.deviceAffected == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
board:
- esp32dev
- esp01
- esp07
- esp12e
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build the code
working-directory: ./device
run: pio run -e ${{ matrix.board }}
ci-agent:
needs: setup
if: ${{ needs.setup.outputs.agentAffected == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- uses: coursier/cache-action@v6
- name: Install Coursier & SBT
uses: coursier/setup-action@v1
- name: Test the code
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./agent
run: sbt coverage test coverageReport
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: agent/target/scala-3.2.2/scoverage-report/
- uses: actions/upload-artifact@v3
with:
name: test-results
path: agent/target/test-reports/
- name: Build an Uberjar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./agent
run: sbt assembly
- name: Build a Docker image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./agent
run: sbt Docker/publishLocal
- name: Build a GraalVM native-image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./agent
run: sbt GraalVMNativeImage/packageBin