Merge pull request #155 from caddishouse/dependabot/hex/dialyxir-1.4.3 #308
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
name: CI/CD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
MIX_ENV: test | |
jobs: | |
test: | |
name: Test on OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} | |
runs-on: ubuntu-latest | |
strategy: | |
# Specify the OTP and Elixir versions to use when building | |
# and running the workflow steps. | |
matrix: | |
otp: ['25.2.1'] # Define the OTP version [required] | |
elixir: ['1.14.3'] # Define the elixir version [required] | |
services: | |
db: | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
image: postgres:11 | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- uses: actions/checkout@v3 | |
- name: Cache deps | |
id: cache-deps | |
uses: actions/cache@v3 | |
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@v3 | |
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- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Compiles without warnings | |
run: mix compile | |
- name: Check Formatting | |
run: mix format --check-formatted | |
- name: Run tests | |
run: mix test --exclude not_implemented | |
deploy: | |
name: Deploy to Fly.io | |
needs: test | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
HONEYBADGER_SECRET: ${{ secrets.HONEYBADGER_SECRET }} | |
MINIO_ACCESS_KEY: ${{ secrets.MINIO_ACCESS_KEY}} | |
MINIO_SECRET_KEY: ${{ secrets.MINIO_SECRET_KEY}} | |
MINIO_HOST: ${{ secrets.MINIO_HOST}} | |
MINIO_PORT: ${{ secrets.MINIO_PORT}} | |
ASSET_URL: ${{ secrets.ASSET_URL}} |