2020-06-15 18:40:33 +12:00
|
|
|
name: Ash CI
|
2020-06-02 13:21:49 +12:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-09-27 18:17:11 +13:00
|
|
|
branches: [main]
|
2020-06-02 18:03:27 +12:00
|
|
|
tags-ignore: ["v*"]
|
2020-06-02 13:21:49 +12:00
|
|
|
pull_request:
|
2021-09-27 18:17:11 +13:00
|
|
|
branches: [main]
|
2020-06-02 18:03:27 +12:00
|
|
|
create:
|
|
|
|
tags: ["v*"]
|
2021-09-27 18:17:11 +13:00
|
|
|
branches: main
|
2020-06-02 13:21:49 +12:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
|
|
strategy:
|
2020-08-26 07:39:40 +12:00
|
|
|
fail-fast: false
|
2020-06-02 13:21:49 +12:00
|
|
|
matrix:
|
2020-08-26 07:39:40 +12:00
|
|
|
include:
|
2022-01-13 07:47:01 +13:00
|
|
|
- elixir: 1.13.1
|
|
|
|
otp: 24.1.2
|
2022-10-13 04:45:31 +13:00
|
|
|
- elixir: 1.14.1
|
|
|
|
otp: 25.1.1
|
2020-06-03 00:52:41 +12:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-06-02 13:21:49 +12:00
|
|
|
steps:
|
2020-06-02 14:00:30 +12:00
|
|
|
- run: sudo apt-get install --yes erlang-dev
|
2020-06-02 13:21:49 +12:00
|
|
|
- uses: actions/checkout@v2
|
2022-12-08 17:44:50 +13:00
|
|
|
- uses: erlef/setup-beam@v1
|
2020-06-02 13:21:49 +12:00
|
|
|
with:
|
2021-03-13 16:33:15 +13:00
|
|
|
experimental-otp: true
|
2020-06-02 13:21:49 +12:00
|
|
|
otp-version: ${{matrix.otp}}
|
|
|
|
elixir-version: ${{matrix.elixir}}
|
|
|
|
- uses: actions/cache@v1
|
|
|
|
id: cache-deps
|
|
|
|
with:
|
2020-06-03 03:20:34 +12:00
|
|
|
path: deps
|
2020-07-01 03:13:56 +12:00
|
|
|
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-
|
2020-06-03 03:20:34 +12:00
|
|
|
- uses: actions/cache@v1
|
|
|
|
id: cache-build
|
|
|
|
with:
|
|
|
|
path: _build
|
2020-07-01 03:13:56 +12:00
|
|
|
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-
|
2020-06-02 13:21:49 +12:00
|
|
|
- run: mix deps.get
|
2020-08-16 09:20:07 +12:00
|
|
|
- run: mix check --except dialyzer
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2020-06-03 01:03:50 +12:00
|
|
|
- run: mix check
|
2020-08-16 09:20:07 +12:00
|
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
2020-08-25 16:49:07 +12:00
|
|
|
release:
|
|
|
|
needs: [build]
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Release
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-04-07 03:59:48 +12:00
|
|
|
otp: ["24.1.2"]
|
2022-05-18 09:14:08 +12:00
|
|
|
elixir: ["1.13.1"]
|
2020-08-25 16:49:07 +12:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
steps:
|
|
|
|
- run: sudo apt-get install --yes erlang-dev
|
|
|
|
- uses: actions/checkout@v2
|
2022-12-08 17:44:50 +13:00
|
|
|
- uses: erlef/setup-beam@v1
|
2020-08-25 16:49:07 +12:00
|
|
|
with:
|
2021-03-13 16:33:15 +13:00
|
|
|
experimental-otp: true
|
2020-08-25 16:49:07 +12:00
|
|
|
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
|
2020-06-03 02:37:31 +12:00
|
|
|
- run: mix hex.publish --yes
|
2020-06-03 00:37:59 +12:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
env:
|
|
|
|
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
|
2020-11-18 20:28:04 +13:00
|
|
|
- uses: little-core-labs/get-git-tag@v3.0.1
|
2020-08-16 10:04:20 +12:00
|
|
|
id: tagName
|
2020-08-16 08:29:56 +12:00
|
|
|
- uses: ethomson/send-tweet-action@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
with:
|
|
|
|
status: |
|
2022-08-04 14:18:26 +12:00
|
|
|
Ash version "${{ steps.tagName.outputs.tag }}" released!
|
2020-08-16 08:29:56 +12:00
|
|
|
|
2020-08-17 19:05:31 +12:00
|
|
|
#myelixirstatus
|
|
|
|
|
2020-08-16 08:29:56 +12:00
|
|
|
See the changelog for more info:
|
2021-09-27 18:17:11 +13:00
|
|
|
https://github.com/ash-project/ash/blob/main/CHANGELOG.md
|
2020-08-16 08:29:56 +12:00
|
|
|
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 }}
|
2022-05-18 04:03:54 +12:00
|
|
|
test-subprojects:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Subproject-${{matrix.project}} - OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-05-18 08:34:14 +12:00
|
|
|
project:
|
|
|
|
[
|
|
|
|
"ash_postgres",
|
|
|
|
"ash_csv",
|
|
|
|
"ash_graphql",
|
|
|
|
"ash_json_api",
|
|
|
|
"ash_phoenix",
|
2022-05-18 09:16:51 +12:00
|
|
|
"ash_admin",
|
2022-07-14 07:12:11 +12:00
|
|
|
"ash_archival",
|
2022-05-18 08:34:14 +12:00
|
|
|
]
|
2022-05-18 04:03:54 +12:00
|
|
|
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}}
|
2022-12-08 17:44:50 +13:00
|
|
|
- uses: erlef/setup-beam@v1
|
2022-05-18 04:03:54 +12:00
|
|
|
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
|
2022-09-21 08:21:25 +12:00
|
|
|
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-
|
2022-05-18 04:03:54 +12:00
|
|
|
- name: mix deps.get inside ./${{matrix.project}}
|
|
|
|
run: mix deps.get
|
|
|
|
working-directory: ./${{matrix.project}}
|
2022-05-18 08:37:50 +12:00
|
|
|
- run: mix test.create
|
|
|
|
if: ${{matrix.project == 'ash_postgres'}}
|
2022-05-18 08:42:41 +12:00
|
|
|
working-directory: ./${{matrix.project}}
|
2022-05-18 08:37:50 +12:00
|
|
|
- run: mix test.migrate
|
|
|
|
if: ${{matrix.project == 'ash_postgres'}}
|
2022-05-18 08:42:41 +12:00
|
|
|
working-directory: ./${{matrix.project}}
|
2022-05-18 08:37:50 +12:00
|
|
|
- run: mix test.migrate_tenants
|
|
|
|
if: ${{matrix.project == 'ash_postgres'}}
|
2022-05-18 08:42:41 +12:00
|
|
|
working-directory: ./${{matrix.project}}
|
2022-05-18 04:03:54 +12:00
|
|
|
- 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}}
|