forked from astarte-platform/astarte
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastarte-libs-build-workflow.yaml
More file actions
127 lines (114 loc) · 3.54 KB
/
astarte-libs-build-workflow.yaml
File metadata and controls
127 lines (114 loc) · 3.54 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
name: Build and Test Astarte Libs
on:
workflow_dispatch:
inputs:
lib:
type: string
description: "Library name under libs/"
required: true
workflow_call:
inputs:
lib:
type: string
description: "Library name under libs/"
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: libs/${{ inputs.lib }}
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: libs/${{ inputs.lib }}
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: libs/${{ inputs.lib }}
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: libs/${{ inputs.lib }}
mix-env: test
- name: Run dialyzer
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: libs/${{ inputs.lib }}
test:
name: Test
needs:
- warmup
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
database:
- "cassandra:3.11.15"
- "scylladb/scylla:2025.2.2"
rabbitmq:
- "rabbitmq:3.12.0-management"
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
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Run Mix Coveralls
uses: team-alembic/staple-actions/actions/mix-task@a74b3b61209d35d45526df174766632f8aee03ed
with:
working-directory: libs/${{ inputs.lib }}
mix-env: test
task: coveralls.json --exclude wip -o coverage_results
- name: Upload Coverage Results to CodeCov
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: ./libs/${{ inputs.lib }}/coverage_results
flags: ${{ inputs.lib }}