-
-
Notifications
You must be signed in to change notification settings - Fork 371
130 lines (128 loc) · 5.39 KB
/
test-subprojects.yml
File metadata and controls
130 lines (128 loc) · 5.39 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
# SPDX-FileCopyrightText: 2019 ash contributors <https://github.com/ash-project/ash/graphs/contributors>
#
# SPDX-License-Identifier: MIT
name: Test Subprojects
on:
push:
tags:
- "v*"
branches: [main]
permissions:
contents: read
jobs:
test-subprojects:
runs-on: ubuntu-latest
name: Subproject ${{matrix.project.org}}/${{matrix.project.name}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
if: github.repository == 'ash-project/ash'
strategy:
fail-fast: false
matrix:
project: [
{
org: "ash-project",
name: "ash_postgres",
migrate: true,
migrate_tenants: true,
generate_migrations: true,
},
{ org: "ash-project", name: "ash_csv" },
{ org: "ash-project", name: "ash_double_entry", migrate: true },
{ org: "ash-project", name: "ash_money" },
{ org: "ash-project", name: "ash_graphql" },
{ org: "ash-project", name: "ash_json_api" },
{ org: "ash-project", name: "ash_phoenix" },
{ org: "ash-project", name: "ash_admin" },
{ org: "ash-project", name: "ash_archival", migrate: true },
{ org: "ash-project", name: "ash_state_machine" },
{ org: "ash-project", name: "ash_appsignal" },
{ org: "ash-project", name: "ash_oban", migrate: true },
{ org: "ash-project", name: "ash_typescript" },
{
org: "ash-project",
name: "ash_sqlite",
migrate: true,
generate_migrations: true
},
{ org: "ash-project", name: "ash_paper_trail" },
{ org: "team-alembic", name: "ash_authentication" },
{ org: "team-alembic", name: "ash_authentication_phoenix" },
# { org: "sevenseacat", name: "tunez", ref: "end-of-chapter-8" }
]
# todo: add 28 here when its available
otp: ["28.2"]
elixir: ["1.19.3"]
services:
pg:
image: 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"]
env:
ASH_CI: true
ASH_VERSION: local
# data layers should be tested against main of `ash_sql`
ASH_SQL_VERSION: main
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ${{matrix.project.org}}/${{matrix.project.name}}
path: ${{matrix.project.name}}
ref: ${{matrix.project.ref}}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ash-project/ash
path: ash
- uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
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@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
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') }}-
- name: mix deps.get inside ./${{matrix.project.name}}
run: mix deps.get
working-directory: ./${{matrix.project.name}}
- run: mix test.create
if: ${{matrix.project.migrate}}
env:
MIX_ENV: test
working-directory: ./${{matrix.project.name}}
- run: mix test.migrate
if: ${{matrix.project.migrate}}
env:
MIX_ENV: test
working-directory: ./${{matrix.project.name}}
- run: mix test.migrate_tenants
env:
MIX_ENV: test
if: ${{matrix.project.migrate_tenants}}
working-directory: ./${{matrix.project.name}}
- name: mix compile --force --warnings-as-errors inside ./${{matrix.project.name}}
run: mix compile --force --warnings-as-errors
env:
MIX_ENV: test
working-directory: ./${{matrix.project.name}}
- name: mix test inside ./${{matrix.project.name}}
run: mix test
working-directory: ./${{matrix.project.name}}
- name: test.generate_migrations --check
run: mix test.generate_migrations --check
working-directory: ./${{matrix.project.name}}
if: ${{matrix.project.generate_migrations}}