Skip to content

chore: update Hex dependencies #487

chore: update Hex dependencies

chore: update Hex dependencies #487

Workflow file for this run

# See output: https://github.com/barsoom/ex-remit/actions
# Set up from these instructions: https://github.com/actions/setup-elixir
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
# Wait for previous run to complete, to avoid concurrent deployment.
# https://github.community/t/how-to-limit-concurrent-workflow-runs/16844/17
# https://github.com/softprops/turnstyle
wait-for-completion:
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- name: Wait for any previous runs to finish
uses: softprops/turnstyle@v1
with:
poll-interval-seconds: 10
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tests:
needs: wait-for-completion
runs-on: ubuntu-latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
services:
db:
image: postgres:14.4 # Keep in sync with dev.yml
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: "remit_test"
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
id: beam
uses: erlef/setup-beam@v1
with:
# NOTE: Keep in sync with elixir_buildpack.config and asdf's .tool-versions.
elixir-version: "1.16.1"
otp-version: "26.2.2"
- name: Cache deps
id: cache-deps
uses: actions/cache@v4
env:
cache-name: cache-elixir-deps
with:
path: deps
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
- name: Cache compiled build
id: cache-build
uses: actions/cache@v4
env:
cache-name: cache-compiled-build
with:
path: _build
key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.cache-name }}-
${{ runner.os }}-mix-
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
- name: Cache PLT
uses: actions/cache@v4
id: plt_cache
with:
path: priv/plts
key: |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
- name: Install deps
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile in dev mode
run: mix compile --warnings-as-errors
# {:mix_audit, "~> 2.0", only: [:dev, :test], runtime: false}
- name: Check vulnerable packages
run: mix deps.audit
- name: Check retired packages
run: mix hex.audit
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt
# {:credo, "~> 1.6", only: [:dev, :test], runtime: false}
- name: Credo
run: mix credo
- name: Compile in test mode
env:
MIX_ENV: test
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test
# {:dialyxir, "~> 1.0", only: [:dev], runtime: false}
- name: Run dialyzer
run: mix dialyzer --format github
# Based on: https://mikecoutermarsh.com/github-actions-deploy-to-heroku/
deploy:
needs: tests
runs-on: ubuntu-latest
# Only if we're on master – not with PRs.
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Heroku credentials
env:
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }}
run: echo "machine git.heroku.com password $HEROKU_API_TOKEN" >> ~/.netrc
- name: Deploy
env:
HEROKU_APP_NAME: "ex-remit"
# Migrations are run by Heroku release phase: see Procfile.
run: git push https://git.heroku.com/$HEROKU_APP_NAME.git origin/master:master