diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ac4fbf5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI +on: + pull_request: + push: + +jobs: + main: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - elixir: '1.18' + erlang: '27.2.2' + lint: true + - elixir: '1.17' + erlang: '26.2.5.7' + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + if: ${{ ! matrix.lint }} + with: + path: | + _build + deps + key: ${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.erlang }}-${{ hashFiles('mix.lock') }} + - uses: erlef/setup-beam@v1 + with: + otp-version: ${{ matrix.erlang }} + elixir-version: ${{ matrix.elixir }} + - 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 compile + if: ${{ ! matrix.lint }} + - run: mix compile --warnings-as-errors + if: ${{ matrix.lint }} + - run: mix test