Skip to content

Commit

Permalink
Update GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
danschultzer committed Nov 19, 2023
1 parent fd74d0a commit 48ef7ad
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: CI

on:
push:
push:
branches: [ main ]
pull_request:
release:
types:
- published
workflow_call:

jobs:
lint:
runs-on: ubuntu-latest
name: Linter
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: 26.0
elixir-version: 1.15
- run: mix deps.get
- run: mix compile --warnings-as-errors
- run: mix credo --strict

test:
strategy:
matrix:
Expand All @@ -24,28 +38,15 @@ jobs:

runs-on: ${{ matrix.version.os }}
name: OTP ${{matrix.version.otp}} / Elixir ${{matrix.version.elixir}} / ${{matrix.html_parser}}
env:
MIX_ENV: test
HTML_PARSER: ${{matrix.html_parser}}
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.version.otp}}
elixir-version: ${{matrix.version.elixir}}
- run: mix deps.get
- run: MIX_ENV=test mix compile
- run: HTML_PARSER=${{matrix.html_parser}} mix test
- run: MIX_ENV=test mix credo --strict
deploy:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
name: Deploy published release
env:
HEX_API_KEY: ${{secrets.HEX_API_KEY}}
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: 25.0
elixir-version: 1.14
- run: mix deps.get
- run: mix hex.publish --yes
- run: mix compile --warnings-as-errors
- run: mix test
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish

on:
release:
types:
- published

jobs:
ci:
uses: ./.github/workflows/ci.yml

publish:
needs: ci
runs-on: ubuntu-latest
name: Publish release
env:
HEX_API_KEY: ${{secrets.HEX_API_KEY}}
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: 26.0
elixir-version: 1.15
- run: mix deps.get
- run: mix hex.publish --yes

0 comments on commit 48ef7ad

Please sign in to comment.