Skip to content

Add dependency on plug #3

Add dependency on plug

Add dependency on plug #3

Workflow file for this run

---
name: Test
on:
push:
branches:
- "main"
pull_request:
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
otp: ['24.3', '25.3', '26.1.2']
elixir: ['1.13.4', '1.14.5', '1.15.7']
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html
exclude:
- otp: '26.1.2'
elixir: '1.13.4'
- otp: '26.1.2'
elixir: '1.14.5'
env:
MIX_ENV: test
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Check out source
uses: actions/checkout@v3
- name: Install Erlang and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Cache deps
id: cache-deps
uses: actions/cache@v3
env:
cache-name: cache-elixir-deps
with:
path: deps
key: ${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-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 }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-${{matrix.otp}}-${{matrix.elixir}}-mix-${{ env.cache-name }}-
- name: Install tools
run: mix do local.rebar --force, local.hex --force
- name: Get Elixir deps
run: mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
# - name: Check formatting
# run: mix format --check-formatted
- name: Run tests
run: mix test
- name: Run credo
run: mix credo --mute-exit-status
# run: mix credo
- name: Run hex.audit
run: mix hex.audit
- name: Run deps.audit
run: mix deps.audit
- name: Run dialyzer
run: mix dialyzer --ignore-exit-status --format github
- name: Publish unit test results to GitHub
uses: EnricoMi/publish-unit-test-result-action@v2
# Run even if tests fail
if: always()
with:
junit_files: _build/test/junit-reports/*.xml
# junit_files: _build/test/lib/*/*.xml
check_name: "Test Results ${{matrix.elixir}} ${{matrix.otp}}"
# - name: Upload results to Datadog
# if: always()
# continue-on-error: true
# env:
# DD_API_KEY: ${{ secrets.ACTIONS_DD_API_KEY }}
# DD_ENV: ci
# run: |
# npm install -g @datadog/datadog-ci
# datadog-ci junit upload --service api-graphql _build/test/lib/*/test-junit-report.xml