Skip to content

Remove tracing and update test matrix. #399

Remove tracing and update test matrix.

Remove tracing and update test matrix. #399

Workflow file for this run

name: Test ❯ Suite
description: |
Quickly runs test suite, typechecks, and lints against our preferred versions of Elixir and OTP.
This action is run continuously on every commit, and can be triggered manually.
NOTES:
- Our preferred versions are documented and read from the .tool-versions file,
and should endeavor to track the latest stable release of each tool.
- See the test matrix workflow for more comprehensive testing against all supported versions of our tools.
on:
- workflow_dispatch
- push
env:
cache-version: 9
MIX_ENV: test
concurrency:
group: test-suite-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Testing
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
version-file: ".tool-versions"
version-type: "strict"
- name: Restore mix dependency installation cache
id: mix-deps-get-cache
uses: actions/cache@v4
with:
path: deps
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install mix dependencies
if: steps.mix-deps-get-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Restore mix dependency compilation cache
id: mix-deps-compile-cache
uses: actions/cache@v4
with:
path: _build
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Compile mix dependencies
if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Run test suite
run: mix test.suites
types:
name: Typechecking
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
version-file: ".tool-versions"
version-type: "strict"
- name: Restore mix dependency installation cache
id: mix-deps-get-cache
uses: actions/cache@v4
with:
path: deps
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install mix dependencies
if: steps.mix-deps-get-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Restore mix dependency compilation cache
id: mix-deps-compile-cache
uses: actions/cache@v4
with:
path: _build
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Compile mix dependencies
if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Restore mix typecheck cache
id: mix-typecheck-cache
uses: actions/cache@v4
with:
path: priv/plts
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-typecheck
- name: Setup typechecking
if: steps.mix-typecheck-cache.outputs.cache-hit != 'true'
run: mix typecheck.build-cache
- name: Run typecheck tasks
run: mix typecheck
lints:
name: Linting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
version-file: ".tool-versions"
version-type: "strict"
- name: Restore mix dependency installation cache
id: mix-deps-get-cache
uses: actions/cache@v4
with:
path: deps
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-get-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install mix dependencies
if: steps.mix-deps-get-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Restore mix dependency compilation cache
id: mix-deps-compile-cache
uses: actions/cache@v4
with:
path: _build
key: cache-${{ env.cache-version }}-os-${{ runner.os }}-otp-${{ steps.beam-versions.outputs.otp-version }}-elixir-${{ steps.beam-versions.outputs.elixir-version }}-mix-deps-compile-mix-lock-file-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Compile mix dependencies
if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
run: mix deps.compile
- name: Run linter tasks
run: mix lint
continue-on-error: true
results:
name: Test Suites Action Results
runs-on: ubuntu-22.04
if: ${{ always() }}
needs:
- tests
- types
- lints
steps:
- name: Test Suite Succeeded
if: ${{ needs.tests.result == 'success' && needs.types.result == 'success' && needs.lints.result == 'success' }}
run: exit 0
- name: Test Suite Failed
if: ${{ needs.tests.result == 'failure' || needs.types.result == 'failure' || needs.lints.result == 'failure' }}
run: exit 1