Replaced shell script by mix task for post start. #64
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 | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# Elixir 1.13 combinations | |
- elixir: '1.13' | |
otp: '25' | |
# Elixir 1.14 combinations | |
- elixir: '1.14' | |
otp: '25' | |
# Elixir 1.15 combinations | |
- elixir: '1.15' | |
otp: '25' | |
- elixir: '1.15' | |
otp: '26' | |
# Elixir 1.16 combinations | |
- elixir: '1.16' | |
otp: '25' | |
- elixir: '1.16' | |
otp: '26' | |
# Elixir 1.17 combinations | |
- elixir: '1.17' | |
otp: '25' | |
- elixir: '1.17' | |
otp: '26' | |
- elixir: '1.17' | |
otp: '27' | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
linting: | |
runs-on: ubuntu-latest | |
needs: setup | |
strategy: | |
matrix: | |
include: | |
# Elixir 1.13 combinations | |
- elixir: '1.13' | |
otp: '25' | |
# Elixir 1.14 combinations | |
- elixir: '1.14' | |
otp: '25' | |
# Elixir 1.15 combinations | |
- elixir: '1.15' | |
otp: '25' | |
- elixir: '1.15' | |
otp: '26' | |
# Elixir 1.16 combinations | |
- elixir: '1.16' | |
otp: '25' | |
- elixir: '1.16' | |
otp: '26' | |
# Elixir 1.17 combinations | |
- elixir: '1.17' | |
otp: '25' | |
- elixir: '1.17' | |
otp: '26' | |
- elixir: '1.17' | |
otp: '27' | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Install dependencies (if not cached) | |
run: mix deps.get | |
- name: Run mix_audit for dependency vulnerabilities | |
run: mix deps.audit | |
- name: Run formatter check | |
run: mix format --check-formatted | |
- name: Run Credo for linting | |
run: mix credo --strict | |
- name: Run Dialyzer for type checking | |
run: mix dialyzer | |
env: | |
MIX_ENV: dev | |
- name: Run Sobelow for security analysis | |
run: mix sobelow --config | |
- name: Cache Dialyzer PLT | |
uses: actions/cache@v3 | |
with: | |
path: _build/dev/*.plt | |
key: ${{ runner.os }}-dialyzer-plt-${{ hashFiles('**/mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-dialyzer-plt- | |
docker-check: | |
runs-on: ubuntu-latest | |
needs: setup | |
strategy: | |
matrix: | |
include: | |
# Elixir 1.13 combinations | |
- elixir: '1.13' | |
otp: '25' | |
# Elixir 1.14 combinations | |
- elixir: '1.14' | |
otp: '25' | |
# Elixir 1.15 combinations | |
- elixir: '1.15' | |
otp: '25' | |
- elixir: '1.15' | |
otp: '26' | |
# Elixir 1.16 combinations | |
- elixir: '1.16' | |
otp: '25' | |
- elixir: '1.16' | |
otp: '26' | |
# Elixir 1.17 combinations | |
- elixir: '1.17' | |
otp: '25' | |
- elixir: '1.17' | |
otp: '26' | |
- elixir: '1.17' | |
otp: '27' | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Build Docker Image | |
run: | | |
docker build --rm --tag $(basename $GITHUB_REPOSITORY):latest . | |
testing: | |
runs-on: ubuntu-latest | |
needs: setup | |
strategy: | |
matrix: | |
include: | |
# Elixir 1.13 combinations | |
- elixir: '1.13' | |
otp: '25' | |
# Elixir 1.14 combinations | |
- elixir: '1.14' | |
otp: '25' | |
# Elixir 1.15 combinations | |
- elixir: '1.15' | |
otp: '25' | |
- elixir: '1.15' | |
otp: '26' | |
# Elixir 1.16 combinations | |
- elixir: '1.16' | |
otp: '25' | |
- elixir: '1.16' | |
otp: '26' | |
# Elixir 1.17 combinations | |
- elixir: '1.17' | |
otp: '25' | |
- elixir: '1.17' | |
otp: '26' | |
- elixir: '1.17' | |
otp: '27' | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v4 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Install dependencies (if not cached) | |
run: mix deps.get | |
- name: Run tests | |
run: mix test | |
# documentation: | |
# runs-on: ubuntu-latest | |
# needs: [setup, testing] | |
# steps: | |
# - name: Check out the code | |
# uses: actions/checkout@v4 | |
# - name: Set up Elixir | |
# uses: erlef/setup-beam@v1 | |
# with: | |
# elixir-version: '1.17' | |
# otp-version: '27.1.2' | |
# - name: Install dependencies (if not cached) | |
# run: mix deps.get | |
# - name: Cache documentation | |
# id: cache-docs | |
# uses: actions/cache@v3 | |
# with: | |
# path: doc | |
# key: ${{ runner.os }}-docs-${{ hashFiles('mix.exs', 'lib/**/*', 'README.md') }} | |
# restore-keys: | | |
# ${{ runner.os }}-docs- | |
# - name: Generate documentation | |
# if: steps.cache-docs.outputs.cache-hit != 'true' | |
# run: mix docs | |
# env: | |
# MIX_ENV: dev | |
# - name: Upload documentation | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: documentation | |
# path: doc/ | |
# deploy: | |
# runs-on: ubuntu-latest | |
# needs: documentation | |
# steps: | |
# - name: Check out the code | |
# uses: actions/checkout@v4 | |
# - name: Configure Git User Identity | |
# run: | | |
# git config --global user.name "GitHub Actions" | |
# git config --global user.email "[email protected]" | |
# - name: Deploy to GitHub Pages | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# run: | | |
# git add doc/ | |
# git commit -m "Update documentation [skip ci]" || echo "No changes to commit" | |
# git push origin ${{ github.head_ref || github.ref_name }} |