ash/.github/workflows/test-subprojects.yml

89 lines
3.8 KiB
YAML
Raw Normal View History

2023-02-01 05:22:49 +13:00
name: Test Subprojects
on:
push:
2023-02-01 05:21:04 +13:00
tags:
- "v*"
branches: [main]
jobs:
test-subprojects:
runs-on: ubuntu-latest
2023-02-01 06:09:40 +13:00
name: Subproject ${{matrix.project.org}}/${{matrix.project.name}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
fail-fast: false
matrix:
project:
[
2023-02-01 05:34:42 +13:00
{ org: "ash-project", name: "ash_postgres" },
{ org: "ash-project", name: "ash_csv" },
2023-10-03 03:28:26 +13:00
{ org: "ash-project", name: "ash_double_entry" },
2023-02-01 05:34:42 +13:00
{ 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" },
2023-10-03 03:28:26 +13:00
{ org: "ash-project", name: "ash_state_machine" },
{ org: "ash-sqlite", name: "ash_sqlite" },
2023-02-01 05:34:42 +13:00
{ org: "team-alembic", name: "ash_authentication" },
{ org: "team-alembic", name: "ash_authentication_phoenix" },
]
otp: ["24"]
2023-10-03 04:33:52 +13:00
elixir: ["1.15.0"]
services:
pg:
image: postgres:13
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
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
with:
2023-02-01 05:34:42 +13:00
repository: ${{matrix.project.org}}/${{matrix.project.name}}
path: ${{matrix.project.name}}
2023-02-01 05:21:04 +13:00
- uses: actions/checkout@v2
with:
repository: ash-project/ash
2023-02-01 05:43:22 +13:00
path: ash
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/cache@v1
id: cache-deps
with:
2023-02-01 05:34:42 +13:00
path: ${{matrix.project.name}}/deps
2023-06-10 16:16:15 +12:00
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@v1
id: cache-build
with:
2023-02-01 05:34:42 +13:00
path: ${{matrix.project.name}}/_build
2023-06-10 16:16:15 +12:00
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') }}-
2023-02-01 05:34:42 +13:00
- name: mix deps.get inside ./${{matrix.project.name}}
run: mix deps.get
2023-02-01 05:34:42 +13:00
working-directory: ./${{matrix.project.name}}
- run: mix test.create
if: ${{matrix.project.name == 'ash_postgres' || matrix.project.name == 'ash_sqlite'}}
2023-02-01 05:34:42 +13:00
working-directory: ./${{matrix.project.name}}
- run: mix test.migrate
if: ${{matrix.project.name == 'ash_postgres' || matrix.project.name == 'ash_sqlite'}}
2023-02-01 05:34:42 +13:00
working-directory: ./${{matrix.project.name}}
- run: mix test.migrate_tenants
if: ${{matrix.project.name == 'ash_postgres' || matrix.project.name == 'ash_sqlite'}}
2023-02-01 05:34:42 +13:00
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
2023-02-01 05:34:42 +13:00
working-directory: ./${{matrix.project.name}}
- name: mix test inside ./${{matrix.project.name}}
run: mix test
2023-02-01 05:34:42 +13:00
working-directory: ./${{matrix.project.name}}