-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathastarte-apps-build-workflow.yaml
More file actions
148 lines (141 loc) · 4.43 KB
/
astarte-apps-build-workflow.yaml
File metadata and controls
148 lines (141 loc) · 4.43 KB
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
140
141
142
143
144
145
146
147
148
name: Build and Test Astarte Apps
on:
workflow_dispatch:
inputs:
app:
type: string
description: ""
required: true
workflow_call:
inputs:
app:
type: string
description: ""
required: true
jobs:
warmup:
name: Cache warmup
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: team-alembic/staple-actions/actions/mix-compile@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: apps/${{ inputs.app }}
mix-env: test
args: "--warnings-as-errors"
formatter:
name: Formatting
runs-on: ubuntu-22.04
needs:
- warmup
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: team-alembic/staple-actions/actions/mix-format@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: apps/${{ inputs.app }}
mix-env: test
credo:
name: Credo
runs-on: ubuntu-22.04
needs:
- warmup
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: team-alembic/staple-actions/actions/mix-credo@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: apps/${{ inputs.app }}
mix-env: test
dialyzer:
name: Dialyzer
runs-on: ubuntu-22.04
needs:
- warmup
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: team-alembic/staple-actions/actions/mix-dialyzer-plt@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: apps/${{ inputs.app }}
mix-env: test
- run: mix dialyzer --format github --force-check
shell: bash
env:
MIX_ENV: "test"
HEX_HOME: ${{ runner.temp }}/.hex
MIX_HOME: ${{ runner.temp }}/.mix
working-directory: apps/${{ inputs.app }}
test:
name: Test
needs:
- warmup
runs-on: ubuntu-22.04
env:
ASTARTE_VAULT_TOKEN: "astarte_token"
strategy:
fail-fast: false
matrix:
database:
- "cassandra:3.11.15"
- "scylladb/scylla:2025.2.2"
rabbitmq:
- "rabbitmq:3.12.0-management"
openbao:
- "openbao/openbao:2"
services:
rabbitmq:
image: ${{ matrix.rabbitmq }}
ports:
- 5672:5672
- 15672:15672
database:
image: ${{ matrix.database }}
ports:
- 9042:9042
options: >-
--health-cmd "cqlsh -e 'SELECT release_version FROM system.local;'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
cfssl:
image: ispirata/docker-alpine-cfssl-autotest:astarte
ports:
- 8080/tcp
openbao:
image: ${{ matrix.openbao }}
ports:
- 8200:8200
env:
BAO_DEV_ROOT_TOKEN_ID: ${{ env.ASTARTE_VAULT_TOKEN }}
BAO_DEV_LISTEN_ADDRESS: "0.0.0.0:8200"
options: >-
--health-cmd "bao status -address=http://127.0.0.1:8200 || exit 1"
--health-interval=2s
--health-timeout=2s
--health-retries=5
rendezvous:
image: astarte/go-fdo-server:ade68cda47-20251128
ports:
- 8041:8041
restart: on-failure
command: '--log-level=debug rendezvous 0.0.0.0:8041 --db-type sqlite --db-dsn "file:/var/lib/fdo/rendezvous.db"'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: team-alembic/staple-actions/actions/mix-task@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: apps/${{ inputs.app }}
mix-env: test
task: coveralls.json --exclude wip -o coverage_results
env:
CFSSL_API_URL: http://localhost:${{ job.services.cfssl.ports[8080] }}
- name: Upload Coverage Results to CodeCov
# Don't upload more than once per component
if: ${{
matrix.database == 'scylladb/scylla:2025.2.2' &&
github.repository == 'astarte-platform/astarte'
}}
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
directory: ./apps/${{ inputs.app }}/coverage_results
flags: ${{ inputs.app }}