ash/.github/workflows/elixir.yml

177 lines
6.1 KiB
YAML
Raw Normal View History

name: Ash CI
2020-06-02 13:21:49 +12:00
on:
push:
2020-06-02 13:44:26 +12:00
branches: [master]
tags-ignore: ["v*"]
2020-06-02 13:21:49 +12:00
pull_request:
2020-06-02 13:44:26 +12:00
branches: [master]
create:
tags: ["v*"]
2020-09-22 11:00:30 +12:00
branches: master
2020-06-02 13:21:49 +12:00
jobs:
build:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
fail-fast: false
2020-06-02 13:21:49 +12:00
matrix:
include:
2020-10-10 03:13:44 +13:00
- elixir: 1.11.0
otp: 23.0.3
2020-06-03 00:52:41 +12:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2020-06-02 13:21:49 +12:00
steps:
- run: sudo apt-get install --yes erlang-dev
2020-06-02 13:21:49 +12:00
- uses: actions/checkout@v2
- uses: actions/setup-elixir@v1
with:
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
- run: mix check --except dialyzer
if: startsWith(github.ref, 'refs/tags/v')
2020-06-03 01:03:50 +12:00
- run: mix check
if: "!startsWith(github.ref, 'refs/tags/v')"
2020-08-28 14:49:10 +12:00
coverage:
needs: [build]
runs-on: ubuntu-latest
name: Report Test Coverage
strategy:
matrix:
otp: ["23"]
elixir: ["1.10.0"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
- uses: actions/setup-elixir@v1
with:
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 coveralls.github
release:
needs: [build]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
name: Release
strategy:
matrix:
otp: ["23"]
elixir: ["1.10.0"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
- uses: actions/setup-elixir@v1
with:
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
- uses: ethomson/send-tweet-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
status: |
2020-08-17 18:35:55 +12:00
Alpha version "${{ steps.tagName.outputs.tag }}" of Ash released!
#myelixirstatus
See the changelog for more info:
https://github.com/ash-project/ash/blob/master/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:
2020-09-04 16:59:32 +12:00
project: [
# We can't reasonably test ash_postgres without including database configuration here, which is a bit much at the moment
# "ash_postgres",
"ash_csv",
"ash_graphql",
"ash_json_api",
"ash_policy_authorizer",
]
otp: ["23"]
elixir: ["1.10.4"]
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}}
ref: master
- uses: actions/setup-elixir@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-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}}
- 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}}