From 247f39c06eaee26e8a2727936683a0479cb4102d Mon Sep 17 00:00:00 2001 From: edgurgel Date: Thu, 30 Nov 2023 18:06:41 +1300 Subject: [PATCH] Add GitHub Actions --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 12 --------- 2 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..4f2036c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,52 @@ +name: CI + +on: [push, pull_request] + +jobs: + format: + name: Format and compile with warnings as errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.1 + + - name: Install OTP and Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: 25.1 + elixir-version: 1.14.1 + + - name: Install dependencies + run: mix deps.get + + - name: Run "mix format" + run: mix format --check-formatted + + - name: Compile with --warnings-as-errors + run: mix compile --warnings-as-errors + + test: + name: Test (Elixir ${{matrix.elixir}} | Erlang/OTP ${{matrix.otp}}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - otp: 25.1 + elixir: 1.14.1 + coverage: true + env: + MIX_ENV: test + steps: + - uses: actions/checkout@v2 + + - name: Install OTP and Elixir + uses: erlef/setup-beam@v1 + with: + otp-version: ${{matrix.otp}} + elixir-version: ${{matrix.elixir}} + + - name: Install dependencies + run: mix deps.get --only test + + - name: Run tests + run: mix test --trace diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 370dfbb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: elixir -matrix: - include: - - otp_release: 22.0 - elixir: 1.9 - - otp_release: 22.0 - elixir: 1.10 -env: - - MIX_ENV=test -script: - - "mix do deps.get, compile, coveralls.travis" - - mix format --check-formatted