diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5fdc741..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: elixir - -branches: - only: - - master - -jobs: - include: - - stage: check formatted - script: mix format --check-formatted - otp_release: 20.3 - elixir: 1.7 - - stage: test - script: mix test - otp_release: 18.3 - elixir: 1.3 - - otp_release: 19.3 - elixir: 1.4 - - otp_release: 20.3 - elixir: 1.5 - - otp_release: 20.3 - elixir: 1.6 - env: STATIX_TEST_RUNTIME_CONFIG=false - - otp_release: 20.3 - elixir: 1.6 - env: STATIX_TEST_RUNTIME_CONFIG=true - - otp_release: 21.0 - elixir: 1.7 diff --git a/README.md b/README.md index fbdf345..1b2603d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Statix -[![Build Status](https://travis-ci.com/lexmag/statix.svg?branch=master)](https://travis-ci.com/lexmag/statix) +![CI Status](https://github.com/lexmag/statix/workflows/CI/badge.svg) [![Hex Version](https://img.shields.io/hexpm/v/statix.svg "Hex Version")](https://hex.pm/packages/statix) Statix is an Elixir client for StatsD-compatible servers. diff --git a/ci.yml b/ci.yml new file mode 100644 index 0000000..efebd1b --- /dev/null +++ b/ci.yml @@ -0,0 +1,71 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + format: + name: Code linting + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up Elixir environment + uses: erlef/setup-elixir@v1 + with: + otp-version: 20.3 + elixir-version: 1.7 + + - name: Check unused dependencies + run: mix deps.get && mix deps.unlock --check-unused + + - name: Check formatting + run: mix format --check-formatted + + - name: Check compilation warnings + run: mix compile --warnings-as-errors + + test: + name: Test suite + runs-on: ubuntu-18.04 + + strategy: + matrix: + versions: + - otp: 18.3 + elixir: 1.3 + - otp: 19.3 + elixir: 1.4 + - otp: 20.3 + elixir: 1.5 + - otp: 20.3 + elixir: 1.6 + - otp: 21.0 + elixir: 1.7 + include: + - versions.otp: 20.3 + versions.elixir: 1.6 + env: + STATIX_TEST_RUNTIME_CONFIG: [true, false] + + env: + MIX_ENV: test + + steps: + - uses: actions/checkout@v2 + + - name: Set up Elixir environment + uses: erlef/setup-elixir@v1 + with: + elixir-version: ${{ matrix.versions.elixir }} + otp-version: ${{ matrix.versions.otp }} + + - name: Install dependencies + run: mix deps.get --only test + + - name: Run tests + run: mix test \ No newline at end of file