From 556b8c1c1142bfde0838c603e089b9f3396c1b54 Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Sat, 18 Nov 2023 19:14:27 -0300 Subject: [PATCH] config: add cache to CI --- .github/workflows/deps.yml | 8 ++++++++ .github/workflows/lint.yml | 37 ++++++++++++++++++++++++----------- .github/workflows/release.yml | 9 ++++----- .github/workflows/test.yml | 17 ++++++++++++---- README.md | 6 ++++++ 5 files changed, 57 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index 4dc042a..0b37c70 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6fd8a9f..2705396 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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] @@ -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] @@ -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] @@ -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] @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ddd2cd5..7bdb0f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3789800..e9b92dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/README.md b/README.md index ed9be63..832bfcb 100644 --- a/README.md +++ b/README.md @@ -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.