-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathastarte-tools-build-workflow.yaml
More file actions
79 lines (76 loc) · 2.33 KB
/
astarte-tools-build-workflow.yaml
File metadata and controls
79 lines (76 loc) · 2.33 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
name: Astarte tools build
on:
# Run when pushing to stable branches
push:
paths:
- 'tools/**'
- '.github/workflows/astarte-tools-build-workflow.yaml'
branches:
- 'master'
- 'release-*'
# Run on branch/tag creation
create:
# Run on pull requests matching tools
pull_request:
paths:
- 'tools/**'
- '.github/workflows/astarte-tools-build-workflow.yaml'
# Allow this workflow to be called by others
workflow_call:
env:
elixir_version: "1.15"
otp_version: "26.1"
jobs:
build:
name: Build tools
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
app:
- astarte_dev_tool
- astarte_device_fleet_simulator
- astarte_import
- astarte_export
database:
- "scylladb/scylla:6.2"
services:
database:
image: ${{ matrix.database }}
ports:
- 9042:9042
env:
CASSANDRA_DB_HOST: 127.0.0.1
CASSANDRA_DB_PORT: 9042
steps:
- name : Checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: tools/${{ matrix.app }}/deps
key: ${{ runner.os }}-mix-${{ env.otp_version }}-${{ env.elixir_version }}-${{ matrix.app }}-${{ hashFiles(format('{0}{1}{2}{3}', github.workspace, '/tools/', matrix.app, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-${{ env.otp_version }}-${{ env.elixir_version }}-${{ matrix.app }}-
- uses: actions/cache@v3
with:
path: tools/${{ matrix.app }}/_build
key: ${{ runner.os }}-_build-${{ env.otp_version }}-${{ env.elixir_version }}-${{ matrix.app }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-_build-${{ env.otp_version }}-${{ env.elixir_version }}-${{ matrix.app }}-
- name: Set up Erlang/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp_version }}
elixir-version: ${{ env.elixir_version }}
- name: Install Dependencies
working-directory: tools/${{ matrix.app }}
run: mix deps.get
- name: Check formatting
working-directory: tools/${{ matrix.app }}
run: mix format --check-formatted
- name: Build
working-directory: tools/${{ matrix.app }}
run: mix compile
- name: Run tests
working-directory: tools/${{ matrix.app }}
run: mix test