-
-
Notifications
You must be signed in to change notification settings - Fork 67
101 lines (100 loc) · 3.73 KB
/
test-projects.yml
File metadata and controls
101 lines (100 loc) · 3.73 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
# SPDX-FileCopyrightText: 2024 igniter contributors <https://github.com/ash-project/igniter/graphs/contributors>
#
# SPDX-License-Identifier: MIT
name: Test Projects
on:
push:
tags:
- "v*"
branches: [main]
jobs:
test-projects:
runs-on: ubuntu-latest
name: ${{matrix.project.org}}/${{matrix.project.name}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
fail-fast: false
matrix:
project: [
{
org: "ash-project",
name: "ash",
test-cmd: "mix test --only igniter",
},
{
org: "team-alembic",
name: "ash_authentication",
test-cmd: "mix test --only igniter",
postgres: true,
},
{
org: "team-alembic",
name: "ash_authentication_phoenix",
test-cmd: "mix test --only igniter",
},
# {
# org: "BeaconCMS",
# name: "beacon",
# test-cmd: "mix test --only igniter",
# },
{
org: "oban-bg",
name: "oban",
test-cmd: "mix test --only igniter",
},
{
org: "mishka-group",
name: "mishka_chelekom",
test-cmd: "mix test --only igniter",
},
]
otp: ["27.2"]
elixir: ["1.18.1"]
services:
pg:
image: ${{ (matrix.project.postgres) && 'postgres:16' || '' }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports: ["5432:5432"]
steps:
- uses: actions/checkout@v2
with:
repository: ${{matrix.project.org}}/${{matrix.project.name}}
path: ${{matrix.project.name}}
ref: ${{matrix.project.ref}}
- run: sudo apt-get install --yes libssl-dev
- uses: actions/checkout@v2
with:
repository: ash-project/igniter
path: igniter
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/cache@v4
id: cache-deps
with:
path: ${{matrix.project.name}}/deps
key: ${{matrix.project.name}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles('config/**/*.exs') }}-${{ hashFiles(format('{0}{1}', github.workspace, '/ash/mix.lock')) }}
restore-keys: ${{matrix.project.name}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles('config/**/*.exs') }}-
- uses: actions/cache@v4
id: cache-build
with:
path: ${{matrix.project.name}}/_build
key: ${{matrix.project.name}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-3-${{ hashFiles('config/**/*.exs') }}-${{ hashFiles(format('{0}{1}', github.workspace, '/ash/mix.lock')) }}
restore-keys: ${{matrix.project.name}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-3-${{ hashFiles('config/**/*.exs') }}-
- run: mix deps.get
working-directory: ./${{matrix.project.name}}
- run: mix archive.install hex igniter_new --force
- run: mix archive.install hex phx_new --force
- run: mix deps.update igniter
working-directory: ./${{matrix.project.name}}
- run: mix igniter.add igniter@path:../igniter --yes
working-directory: ./${{matrix.project.name}}
- run: mix deps.get
working-directory: ./${{matrix.project.name}}
- run: ${{matrix.project.test-cmd}}
if: ${{matrix.project.test-cmd}}
working-directory: ./${{matrix.project.name}}