Created
July 30, 2022 07:49
-
-
Save colindensem/456625670d3b821516a0b6cb47e22a51 to your computer and use it in GitHub Desktop.
Ci with dialyzer - old config for memories only
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
# .github/workflows/ci.yml | |
on: push | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
otp: [22.2.8] | |
elixir: [1.11.2] | |
services: | |
db: | |
image: postgres:11-alpine | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: compass_test | |
ports: ["5432:5432"] | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup elixir | |
- uses: actions/setup-elixir@v1 | |
with: | |
otp-version: ${{ matrix.otp }} | |
elixir-version: ${{ matrix.elixir }} | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12.15.0 | |
- name: Fetch Mix dependencies cache | |
- uses: actions/cache@v1 | |
id: mix-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- uses: actions/cache@v1 | |
id: build-cache | |
with: | |
path: _build | |
key: ${{ runner.os }}-build-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Find yarn cache location | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Mix dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
- name: Install Yarn dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: | | |
(cd assets && yarn) | |
- name: Check Formatting | |
run: mix format --check-formatted | |
- name: Check Security | |
run: mix sobelow --config | |
- name: Static Code Analysis | |
run: mix credo --strict | |
- name: Retrieve PLT Cache | |
uses: actions/cache@v1 | |
id: plt-cache | |
with: | |
path: priv/plts | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Create PLTs | |
if: steps.plt-cache.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p priv/plts | |
mix dialyzer --plt | |
- name: Run dialyzer | |
run: mix dialyzer --no-check --halt-exit-status | |
- name: Tests | |
run: mix test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment