-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
159 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: deps | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
MIX_ENV: test | ||
|
||
jobs: | ||
deps: | ||
name: Dependencies | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
elixir: [1.15.7] | ||
otp: [26.1.2] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-beam@v1 | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
- run: | | ||
mix local.rebar --force | ||
mix local.hex --force | ||
mix deps.get | ||
mix deps.compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_run: | ||
workflows: [deps lint test] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish: | ||
runs-ons: ubuntu-latest | ||
matrix: | ||
elixir: [1.15.7] | ||
otp: [26.1.2] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
- name: Publish to Hex | ||
uses: synchronal/hex-publish-action@v3 | ||
with: | ||
name: supabase_potion | ||
key: ${{ secrets.HEX_PM_KEY }} | ||
tag-release: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_run: | ||
workflows: [deps lint] | ||
types: | ||
- completed | ||
|
||
env: | ||
MIX_ENV: test | ||
|
||
jobs: | ||
build: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
env: | ||
GHCR_USERNAME: ${{ github.actor }} | ||
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }} | ||
FORCE_COLOR: 1 | ||
needs: | ||
- deps | ||
- lint | ||
strategy: | ||
matrix: | ||
elixir: [1.15.7] | ||
otp: [26.1.2] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Put back the git branch into git (Earthly uses it for tagging) | ||
run: | | ||
branch="" | ||
if [ -n "$GITHUB_HEAD_REF" ]; then | ||
branch="$GITHUB_HEAD_REF" | ||
else | ||
branch="${GITHUB_REF##*/}" | ||
fi | ||
git checkout -b "$branch" || true | ||
- name: Docker Login | ||
run: docker login https://ghcr.io --username "$GHCR_USERNAME" --password "$GHCR_TOKEN" | ||
- name: Download latest earthly | ||
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" | ||
- name: Earthly version | ||
run: earthly --version | ||
- name: Run unit tests | ||
run: earthly -P +unit-test | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-beam@v1 | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
- run: mix test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters