diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..28acd003 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,91 @@ +name: CI + +on: + - push + - pull_request + +jobs: + format: + name: Format and compile with warnings as errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Install OTP and Elixir + uses: actions/setup-elixir@v1 + with: + otp-version: "23.0" + elixir-version: "1.11.2" + + - name: Install dependencies + run: mix deps.get + + # TODO: Enable in next release + # + # At the moment, we still have pending PRs etc. + # and introducing auto-formatting now would cause + # a ton of conflicts. + # + # - name: Check mix format + # run: mix format --check-formatted + + - name: Compile with warnings as errors + run: mix compile --warnings-as-errors + + analysis: + name: Run static code analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Install OTP and Elixir + uses: actions/setup-elixir@v1 + with: + otp-version: "23.0" + elixir-version: "1.11.2" + + - name: Install dependencies + run: mix deps.get + + - name: Analyze code + run: mix credo --strict + + test: + name: Test Elixir ${{ matrix.elixir }}, OTP ${{ matrix.erlang }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - erlang: "23.0" + elixir: "1.11.2" + - erlang: "23.0" + elixir: "1.10.3" + - erlang: "22.3" + elixir: "1.9.4" + - erlang: "21.3" + elixir: "1.8.2" + - erlang: "20.3.1" + elixir: "1.7.4" + - erlang: "19.3" + elixir: "1.6.6" + - erlang: "18.3" + elixir: "1.5.3" + + steps: + - uses: actions/checkout@v1 + + - name: Install OTP and Elixir + uses: actions/setup-elixir@v1 + with: + otp-version: ${{ matrix.erlang }} + elixir-version: ${{ matrix.elixir }} + + - name: Install dependencies + run: mix deps.get --only test + + - name: Run unit tests + run: mix test --trace --exclude functional + + - name: Run functional tests + run: mix test --trace --only functional diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9deac7f3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: elixir - -# Compatibility between Elixir and Erlang/OTP -# https://hexdocs.pm/elixir/master/compatibility-and-deprecations.html -matrix: - include: - - elixir: 1.5 - otp_release: 18.1 - services: docker - - elixir: 1.5 - otp_release: 20.3 - services: docker - - elixir: 1.6 - otp_release: 19.0 - services: docker - - elixir: 1.6 - otp_release: 20.3 - services: docker - -before_script: - - chmod -R g-w test/fixtures # y u no work as expected travis? - -script: - - mix credo --strict - - mix test --exclude functional - - mix test --only functional - -after_script: - - mix inch.report