2023-02-01 05:15:09 +13:00
|
|
|
name: Ash CI
|
|
|
|
on:
|
|
|
|
workflow_call:
|
2023-02-17 11:34:17 +13:00
|
|
|
secrets:
|
|
|
|
HEX_API_KEY:
|
|
|
|
required: false
|
2023-02-01 15:06:07 +13:00
|
|
|
inputs:
|
|
|
|
spark-formatter:
|
|
|
|
type: boolean
|
|
|
|
default: true
|
2023-09-15 09:16:35 +12:00
|
|
|
spark-cheat-sheets:
|
|
|
|
type: boolean
|
|
|
|
default: true
|
2023-02-04 19:55:50 +13:00
|
|
|
sobelow:
|
|
|
|
type: boolean
|
|
|
|
default: true
|
2023-02-01 16:49:08 +13:00
|
|
|
postgres:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2023-11-18 00:38:36 +13:00
|
|
|
postgres-version:
|
|
|
|
type: string
|
|
|
|
default: "13"
|
2023-10-12 08:57:26 +13:00
|
|
|
sqlite:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2023-02-17 11:29:16 +13:00
|
|
|
hex-api-key:
|
|
|
|
type: string
|
2023-12-21 03:24:07 +13:00
|
|
|
ash-three:
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
env:
|
|
|
|
ASH_THREE: ${{inputs.ash-three}}
|
2023-02-01 05:15:09 +13:00
|
|
|
jobs:
|
|
|
|
deps:
|
|
|
|
name: mix deps.get
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-deps-get@main
|
|
|
|
|
|
|
|
auditor:
|
|
|
|
name: mix hex.audit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: deps
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-hex-audit@main
|
|
|
|
|
|
|
|
build-test:
|
|
|
|
name: MIX_ENV=test mix.compile
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: deps
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/install-elixir@main
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-compile@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
formatter:
|
|
|
|
name: mix format --check-formatted
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-format@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
2023-02-01 16:19:28 +13:00
|
|
|
|
2023-02-01 16:15:44 +13:00
|
|
|
spark-formatter:
|
|
|
|
name: mix spark.formatter --check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.spark-formatter}}
|
2023-02-01 16:15:44 +13:00
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: spark.formatter --check
|
2023-09-15 09:16:35 +12:00
|
|
|
|
|
|
|
spark-cheat-sheets:
|
|
|
|
name: mix spark.cheat_sheets --check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
if: ${{inputs.spark-cheat-sheets}}
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: spark.cheat_sheets --check
|
2023-02-04 19:55:50 +13:00
|
|
|
sobelow:
|
|
|
|
name: mix sobelow
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.sobelow}}
|
2023-02-04 19:55:50 +13:00
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: sobelow
|
2023-02-01 05:21:04 +13:00
|
|
|
credo:
|
|
|
|
name: mix credo --strict
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-credo@main
|
2023-02-01 15:11:04 +13:00
|
|
|
if: ${{inputs.spark-formatter}}
|
2023-02-01 05:21:04 +13:00
|
|
|
with:
|
|
|
|
mix-env: test
|
2023-02-01 18:54:11 +13:00
|
|
|
unused-deps:
|
|
|
|
name: mix deps.unlock --check-unused
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: deps.unlock --check-unused
|
2023-02-01 05:15:09 +13:00
|
|
|
|
|
|
|
# Need to clean lots of things up before we can add this
|
|
|
|
# doctor:
|
|
|
|
# name: mix doctor --full --raise
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# needs: build-test
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v3
|
|
|
|
# - uses: team-alembic/staple-actions/actions/mix-doctor@main
|
|
|
|
# with:
|
|
|
|
# mix-env: test
|
2023-03-29 15:38:50 +13:00
|
|
|
|
2023-02-06 18:44:28 +13:00
|
|
|
test:
|
2023-02-01 05:15:09 +13:00
|
|
|
name: mix test
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
services:
|
|
|
|
postgres:
|
2023-11-18 00:38:36 +13:00
|
|
|
image: postgres:${{inputs.postgres-version}}
|
2023-02-01 05:15:09 +13:00
|
|
|
env:
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-02-01 16:46:40 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_postgres.generate_migrations --check
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.postgres}}
|
2023-02-01 16:46:40 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_postgres.create
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.postgres}}
|
2023-02-01 16:46:40 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_postgres.migrate
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.postgres}}
|
2023-02-01 16:46:40 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_postgres.migrate --tenants
|
2023-02-06 18:43:59 +13:00
|
|
|
if: ${{inputs.postgres}}
|
2023-10-12 08:57:26 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_sqlite.generate_migrations --check
|
|
|
|
if: ${{inputs.sqlite}}
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_sqlite.create
|
|
|
|
if: ${{inputs.sqlite}}
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_sqlite.migrate
|
|
|
|
if: ${{inputs.sqlite}}
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-task@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
task: ash_sqlite.migrate --tenants
|
|
|
|
if: ${{inputs.sqlite}}
|
2023-02-01 05:15:09 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-test@main
|
|
|
|
with:
|
|
|
|
mix-env: test
|
|
|
|
env:
|
|
|
|
PGUSER: postgres
|
|
|
|
PGPASS: postgres
|
|
|
|
PGHOST: postgres
|
2023-03-29 15:38:50 +13:00
|
|
|
|
2023-02-01 05:15:09 +13:00
|
|
|
dialyzer:
|
|
|
|
name: mix dialyzer
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-test
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-dialyzer@main
|
|
|
|
with:
|
2023-02-01 13:00:22 +13:00
|
|
|
mix-env: dev
|
2023-02-01 05:15:09 +13:00
|
|
|
|
|
|
|
build-dev:
|
|
|
|
name: MIX_ENV=dev mix.compile
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-01 18:51:10 +13:00
|
|
|
needs: deps
|
2023-02-01 18:49:20 +13:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: team-alembic/staple-actions/actions/mix-compile@main
|
|
|
|
with:
|
|
|
|
mix-env: dev
|
|
|
|
release:
|
2023-02-01 05:15:09 +13:00
|
|
|
needs:
|
|
|
|
- credo
|
2023-02-01 18:54:11 +13:00
|
|
|
- unused-deps
|
2023-02-01 05:22:05 +13:00
|
|
|
# - doctor
|
2023-02-01 16:19:28 +13:00
|
|
|
- spark-formatter
|
2023-12-21 03:27:47 +13:00
|
|
|
- spark-cheat-sheets
|
2023-02-04 19:55:50 +13:00
|
|
|
- sobelow
|
2023-02-01 05:15:09 +13:00
|
|
|
- formatter
|
|
|
|
- auditor
|
|
|
|
- test
|
|
|
|
- dialyzer
|
2023-02-01 18:49:44 +13:00
|
|
|
- build-dev
|
2023-02-10 10:24:30 +13:00
|
|
|
- deps
|
2023-02-17 17:42:14 +13:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2023-02-01 05:15:09 +13:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Release
|
|
|
|
steps:
|
2023-02-10 09:52:29 +13:00
|
|
|
- uses: actions/checkout@v3
|
2023-02-10 16:34:41 +13:00
|
|
|
- uses: team-alembic/staple-actions/actions/mix-hex-publish@main
|
|
|
|
with:
|
|
|
|
mix-env: dev
|
2023-02-17 11:33:08 +13:00
|
|
|
hex-api-key: ${{secrets.HEX_API_KEY}}
|