mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
85 lines
3.5 KiB
YAML
85 lines
3.5 KiB
YAML
name: Test Subprojects
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
branches: [main]
|
|
jobs:
|
|
test-subprojects:
|
|
runs-on: ubuntu-latest
|
|
name: Subproject ${{matrix.project.org}}/${{matrix.project.name}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
project:
|
|
[
|
|
{ org: "ash-project", name: "ash_postgres" },
|
|
{ org: "ash-project", name: "ash_csv" },
|
|
{ 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" },
|
|
{ org: "team-alembic", name: "ash_authentication" },
|
|
{ org: "team-alembic", name: "ash_authentication_phoenix" },
|
|
]
|
|
otp: ["24"]
|
|
elixir: ["1.14.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:
|
|
repository: ${{matrix.project.org}}/${{matrix.project.name}}
|
|
path: ${{matrix.project.name}}
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
repository: ash-project/ash
|
|
path: ash
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: ${{matrix.otp}}
|
|
elixir-version: ${{matrix.elixir}}
|
|
- uses: actions/cache@v1
|
|
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@v1
|
|
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.name == 'ash_postgres'}}
|
|
working-directory: ./${{matrix.project.name}}
|
|
- run: mix test.migrate
|
|
if: ${{matrix.project.name == 'ash_postgres'}}
|
|
working-directory: ./${{matrix.project.name}}
|
|
- run: mix test.migrate_tenants
|
|
if: ${{matrix.project.name == 'ash_postgres'}}
|
|
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}}
|