ash/.github/workflows/test-subprojects.yml
2023-01-31 11:21:04 -05:00

90 lines
3.3 KiB
YAML

name: Ash CI
on:
push:
tags:
- "v*"
branches: [main]
jobs:
test-subprojects:
runs-on: ubuntu-latest
name: Subproject-${{matrix.project}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
fail-fast: false
matrix:
project:
[
"ash-project/ash_postgres",
"ash-project/ash_csv",
"ash-project/ash_graphql",
"ash-project/ash_json_api",
"ash-project/ash_phoenix",
"ash-project/ash_admin",
"ash-project/ash_archival",
"team-alembic/ash_authentication",
"team-alembic/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
- name: Split project_org
id: split
env:
PROJECT: ${{ matrix.project }}
run: echo "::set-output project_org=fragment::${PROJECT##*/}"
- uses: actions/checkout@v2
with:
repository: ${{matrix.project}}
path: ${{matrix.project}}
- uses: actions/checkout@v2
with:
repository: ash-project/ash
path: ${{steps.split.output.project_org}}
- 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}}/deps
key: ${{matrix.project}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles(format('{0}{1}', github.workspace, '/ash/mix.lock')) }}
restore-keys: ${{matrix.project}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-
- uses: actions/cache@v1
id: cache-build
with:
path: ${{matrix.project}}/_build
key: ${{matrix.project}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-3-${{ hashFiles(format('{0}{1}', github.workspace, '/ash/mix.lock')) }}
restore-keys: ${{matrix.project}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-3-
- name: mix deps.get inside ./${{matrix.project}}
run: mix deps.get
working-directory: ./${{matrix.project}}
- run: mix test.create
if: ${{matrix.project == 'ash-project/ash_postgres'}}
working-directory: ./${{matrix.project}}
- run: mix test.migrate
if: ${{matrix.project == 'ash-project/ash_postgres'}}
working-directory: ./${{matrix.project}}
- run: mix test.migrate_tenants
if: ${{matrix.project == 'ash-project/ash_postgres'}}
working-directory: ./${{matrix.project}}
- name: mix compile --force --warnings-as-errors inside ./${{matrix.project}}
run: mix compile --force --warnings-as-errors
env:
MIX_ENV: test
working-directory: ./${{matrix.project}}
- name: mix test inside ./${{matrix.project}}
run: mix test
working-directory: ./${{matrix.project}}