mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
173 lines
6 KiB
YAML
173 lines
6 KiB
YAML
name: Ash CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags-ignore: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
create:
|
|
tags: ["v*"]
|
|
branches: main
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- elixir: 1.13.1
|
|
otp: 24.1.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- run: sudo apt-get install --yes erlang-dev
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-elixir@v1.5
|
|
with:
|
|
experimental-otp: true
|
|
otp-version: ${{matrix.otp}}
|
|
elixir-version: ${{matrix.elixir}}
|
|
- uses: actions/cache@v1
|
|
id: cache-deps
|
|
with:
|
|
path: deps
|
|
key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-
|
|
- uses: actions/cache@v1
|
|
id: cache-build
|
|
with:
|
|
path: _build
|
|
key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-2-
|
|
- run: mix deps.get
|
|
- run: mix check --except dialyzer
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
- run: mix check
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
release:
|
|
needs: [build]
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-latest
|
|
name: Release
|
|
strategy:
|
|
matrix:
|
|
otp: ["24.1.2"]
|
|
elixir: ["1.13.1"]
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- run: sudo apt-get install --yes erlang-dev
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-elixir@v1.5
|
|
with:
|
|
experimental-otp: true
|
|
otp-version: ${{matrix.otp}}
|
|
elixir-version: ${{matrix.elixir}}
|
|
- uses: actions/cache@v1
|
|
id: cache-deps
|
|
with:
|
|
path: deps
|
|
key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-
|
|
- run: mix deps.get
|
|
- run: mix compile
|
|
- run: mix hex.publish --yes
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
|
|
- uses: little-core-labs/get-git-tag@v3.0.1
|
|
id: tagName
|
|
- uses: ethomson/send-tweet-action@v1
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
with:
|
|
status: |
|
|
Ash version "${{ steps.tagName.outputs.tag }}" released!
|
|
|
|
#myelixirstatus
|
|
|
|
See the changelog for more info:
|
|
https://github.com/ash-project/ash/blob/main/CHANGELOG.md
|
|
consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
|
|
consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
|
|
access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
|
|
access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
|
|
test-subprojects:
|
|
runs-on: ubuntu-latest
|
|
name: Subproject-${{matrix.project}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
project:
|
|
[
|
|
"ash_postgres",
|
|
"ash_csv",
|
|
"ash_graphql",
|
|
"ash_json_api",
|
|
"ash_phoenix",
|
|
"ash_admin",
|
|
"ash_archival",
|
|
]
|
|
otp: ["23"]
|
|
elixir: ["1.13.1"]
|
|
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:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
ASH_CI: true
|
|
ASH_VERSION: local
|
|
steps:
|
|
- run: sudo apt-get install --yes erlang-dev
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
repository: ash-project/ash
|
|
path: ash
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
repository: ash-project/${{matrix.project}}
|
|
path: ${{matrix.project}}
|
|
- uses: actions/setup-elixir@v1.5
|
|
with:
|
|
experimental-otp: true
|
|
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-2-${{ hashFiles(format('{0}{1}', github.workspace, '/ash/mix.lock')) }}
|
|
restore-keys: ${{matrix.project}}-otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-2-
|
|
- name: mix deps.get inside ./${{matrix.project}}
|
|
run: mix deps.get
|
|
working-directory: ./${{matrix.project}}
|
|
- run: mix test.create
|
|
if: ${{matrix.project == 'ash_postgres'}}
|
|
working-directory: ./${{matrix.project}}
|
|
- run: mix test.migrate
|
|
if: ${{matrix.project == 'ash_postgres'}}
|
|
working-directory: ./${{matrix.project}}
|
|
- run: mix test.migrate_tenants
|
|
if: ${{matrix.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}}
|