Skip to content

Commit

Permalink
Add first GitHub CI setup (#28)
Browse files Browse the repository at this point in the history
* Implement CI

* Try to run the workflow from my branch

Unsure about the syntax at this point.

* Revert "Try to run the workflow from my branch"

This reverts commit ef7b26f.

* Test running on branch itself?

* Trying more things

---------

Co-authored-by: Thomas Millar <[email protected]>
  • Loading branch information
thbar and thmsmlr authored Mar 5, 2024
1 parent a926ddc commit 2d79c28
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
workflow_dispatch:
pull_request:
types:
- *
push:
branches:
- main
- setup-ci

jobs:
test:
runs-on: ubuntu-20.04
env:
MIX_ENV: test
strategy:
fail-fast: false
matrix:
include:
- pair:
elixir: "1.11"
otp: "21.3"
- pair:
elixir: "1.16"
otp: "26.2"
lint: lint
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}

- uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- run: mix deps.get --check-locked

- run: mix format --check-formatted
if: ${{ matrix.lint }}

- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}

- run: mix deps.compile

- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}

- run: mix test

0 comments on commit 2d79c28

Please sign in to comment.