Skip to content

Commit

Permalink
Add edge-testing action.
Browse files Browse the repository at this point in the history
  • Loading branch information
christhekeele committed Apr 14, 2024
1 parent 5a8b8ad commit 94fc7fe
Showing 1 changed file with 121 additions and 0 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/test-edge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Test ❯ Edge
# Runs tests against edge versions of Erlang/OTP and Elixir
# to get ahead of incompatible changes.

on:
# Allow running from GitHub UI.
workflow_dispatch: {}

# Run daily.
schedule:
- cron: 0 0 * * *

env:
edge-elixir: "master"
edge-otp: "x"
MIX_ENV: test

concurrency:
group: test-edge-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Testing Edge
runs-on: ${{ vars.PREFERRED_OS }}

steps:
- uses: actions/checkout@v4

- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.edge-elixir }}
otp-version: ${{ env.edge-otp }}

- name: Unlock dependencies
run: mix deps.unlock --all

- name: Install mix dependencies
run: mix deps.get

- name: Compile mix dependencies
run: mix deps.compile

- name: Run test suite
run: mix test

types:
# Skip type checking for now
if: ${{ !always() }}
name: Typechecking Edge
runs-on: ${{ vars.PREFERRED_OS }}

steps:
- uses: actions/checkout@v4

- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.edge-elixir }}
otp-version: ${{ env.edge-otp }}

- name: Unlock dependencies
run: mix deps.unlock --all

- name: Install mix dependencies
run: mix deps.get

- name: Compile mix dependencies
run: mix deps.compile

- name: Run typecheck tasks
run: mix typecheck

lints:
name: Linting Edge
runs-on: ${{ vars.PREFERRED_OS }}

steps:
- uses: actions/checkout@v4

- name: Install Erlang & Elixir
id: beam-versions
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.edge-elixir }}
otp-version: ${{ env.edge-otp }}

- name: Unlock dependencies
run: mix deps.unlock --all

- name: Install mix dependencies
run: mix deps.get

- name: Compile mix dependencies
run: mix deps.compile

- name: Run linter tasks
run: mix lint
continue-on-error: true

results:
name: Test Edge Action Results
runs-on: ${{ vars.PREFERRED_OS }}

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

0 comments on commit 94fc7fe

Please sign in to comment.