ash_postgres/.github/workflows/elixir.yml

108 lines
3.6 KiB
YAML
Raw Normal View History

2020-06-03 14:47:41 +12:00
name: Elixir CI
on:
push:
2022-04-28 01:55:08 +12:00
branches: [main]
2020-06-03 14:47:41 +12:00
tags-ignore: ["v*"]
pull_request:
2022-04-28 01:55:08 +12:00
branches: [main]
2020-06-03 14:47:41 +12:00
create:
2022-04-28 01:55:08 +12:00
branches: main
2020-06-03 14:47:41 +12:00
tags: ["v*"]
jobs:
build:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} / Ash ${{matrix.ash}}
2020-06-03 14:47:41 +12:00
strategy:
fail-fast: false
2020-06-03 14:47:41 +12:00
matrix:
2021-01-23 10:44:46 +13:00
otp: ["23"]
2022-04-18 16:28:02 +12:00
elixir: ["1.13.2"]
2022-08-06 07:31:35 +12:00
ash: ["1.53"]
pg_version: ["12", "13"]
2020-06-03 14:47:41 +12:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASH_VERSION: ${{matrix.ash}}
2020-09-03 20:18:11 +12:00
services:
pg:
image: postgres:${{ matrix.pg_version }}
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"]
2020-06-03 14:47:41 +12:00
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
2021-03-30 03:12:37 +13:00
- uses: erlef/setup-elixir@v1
2020-06-03 14:47:41 +12:00
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
2020-10-29 15:26:45 +13:00
- uses: actions/cache@v2
2020-06-03 14:47:41 +12:00
id: cache-deps
with:
path: deps
2020-08-19 17:21:59 +12:00
key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
2020-08-19 17:24:48 +12:00
restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-deps-2
2020-10-29 15:26:45 +13:00
- uses: actions/cache@v2
2020-06-03 14:47:41 +12:00
id: cache-build
with:
path: _build
2020-08-19 17:21:59 +12:00
key: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-2-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
2020-08-19 17:24:48 +12:00
restore-keys: otp-${{matrix.otp}}-elixir-${{matrix.elixir}}-build-2
2020-06-03 14:47:41 +12:00
- run: mix deps.get
- run: mix test.create
- run: mix test.migrate
- run: mix test.migrate_tenants
2020-08-17 18:46:44 +12:00
- run: mix check --except dialyzer
if: startsWith(github.ref, 'refs/tags/v')
2020-06-03 14:47:41 +12:00
- run: mix check
2020-08-17 18:46:44 +12:00
if: "!startsWith(github.ref, 'refs/tags/v')"
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
name: Release
needs: [build]
strategy:
matrix:
otp: ["23"]
2022-04-18 16:28:02 +12:00
elixir: ["1.13.2"]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: sudo apt-get install --yes erlang-dev
- uses: actions/checkout@v2
2021-03-30 03:12:37 +13:00
- uses: erlef/setup-elixir@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
2020-10-29 15:26:45 +13:00
- uses: actions/cache@v2
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 14:47:41 +12:00
- run: mix hex.publish --yes
if: startsWith(github.ref, 'refs/tags/v')
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
2020-11-18 20:27:53 +13:00
- uses: little-core-labs/get-git-tag@v3.0.1
2020-08-16 10:16:33 +12:00
id: tagName
- uses: ethomson/send-tweet-action@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
status: |
2022-08-06 07:28:18 +12:00
AshPostgres version "${{ steps.tagName.outputs.tag }}" released!
2020-08-16 10:16:33 +12:00
#myelixirstatus
2020-08-16 10:16:33 +12:00
See the changelog for more info:
2022-04-28 01:55:08 +12:00
https://github.com/ash-project/ash_postgres/blob/main/CHANGELOG.md
2020-08-16 10:16:33 +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 }}