Skip to content

Commit

Permalink
config: add cache to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed Nov 18, 2023
1 parent 7100831 commit 556b8c1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 20 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ jobs:
mix local.hex --force
mix deps.get
mix deps.compile
- id: mix-deps
uses: actions/cache/save@v3
with:
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: mix-deps
path: |
deps
_build
37 changes: 26 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@ on:
push:
branches: [main]
pull_request:
workflow_run:
workflows: [deps]
types:
- completed

env:
MIX_ENV: test

jobs:
deps:
name: Restore Cached deps
runs-on: ubuntu-latest
steps:
- id: mix-deps-restore
uses: actions/cache/restore@v3
with:
key: mix-deps
path: |
_build
deps
compile:
name: Check compile warning
run-ons: ubuntu-latest
runs-on: ubuntu-latest
needs:
- deps
strategy:
matrix:
elixir: [1.15.7]
Expand All @@ -31,7 +40,9 @@ jobs:
- run: mix compile --warnings-as-errors
format:
name: Code format
run-ons: ubuntu-latest
runs-on: ubuntu-latest
needs:
- deps
strategy:
matrix:
elixir: [1.15.7]
Expand All @@ -40,14 +51,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-elixir
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- run: mix format --check-formatted
credo:
name: Static Code Analysis
run-ons: ubuntu-latest
runs-on: ubuntu-latest
needs:
- deps
strategy:
matrix:
elixir: [1.15.7]
Expand All @@ -56,14 +69,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-elixir
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- run: mix credo --strict
dialyzer:
name: Dialyzer
run-ons: ubuntu-latest
runs-on: ubuntu-latest
needs:
- deps
strategy:
matrix:
elixir: [1.15.7]
Expand All @@ -72,7 +87,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-elixir
- uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ on:
push:
tags:
- '*'
workflow_run:
workflows: [deps lint test]
types:
- completed

env:
MIX_ENV: prod

jobs:
publish:
runs-ons: ubuntu-latest
runs-on: ubuntu-latest
matrix:
elixir: [1.15.7]
otp: [26.1.2]
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,27 @@ on:
push:
branches: [main]
pull_request:
workflow_run:
workflows: [deps lint]
types:
- completed

env:
MIX_ENV: test

jobs:
deps:
name: Restore Cached deps
runs-on: ubuntu-latest
steps:
- id: mix-deps-restore
uses: actions/cache/restore@v3
with:
key: mix-deps
path: |
_build
deps
test:
name: Run tests
runs-on: ubuntu-latest
needs:
- deps
needs:
- deps
- lint
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Supabase Potion

[![Hex.pm](https://img.shields.io/hexpm/v/supabase_potion.svg)](https://hex.pm/packages/supabase_potion)
[![Downloads](https://img.shields.io/hexpm/dt/supabase_potion.svg)](https://hex.pm/packages/supabase_potion)
[![Documentation](https://img.shields.io/badge/documentation-gray)](https://hexdocs.pm/supabase_potion)
[![lint](https://github.com/zoedsoupe/supabase/actions/workflows/lint.yml/badge.svg)](https://github.com/zoedsoupe/supabase/actions/workflows/lint.yml)
[![test](https://github.com/zoedsoupe/supabase/actions/workflows/test.yml/badge.svg)](https://github.com/zoedsoupe/supabase/actions/workflows/test.yml)

> Complete SDK and APIs integrations with Supabase
This monorepo houses the collection of Elixir SDK packages for integrating with Supabase, the open-source Firebase alternative. Our goal is to offer developers a seamless integration experience with Supabase services using Elixir.
Expand Down

0 comments on commit 556b8c1

Please sign in to comment.