diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..66748d9a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: Tests + +on: + push: + pull_request: + branches: + - main + +jobs: + tests: + name: Run tests (Elixir ${{matrix.elixir}}, OTP ${{matrix.otp}}), OS ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - elixir: "1.6.6" + otp: "19.0" + os: ubuntu-18.04 + - elixir: "1.17" + otp: "27.0" + os: ubuntu-24.04 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-elixir@v1 + with: + elixir-version: ${{ matrix.elixir }} + otp-version: ${{ matrix.otp }} + + - name: Restore deps and _build cache + uses: actions/cache@v4 + with: + path: | + deps + _build + key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }} + - name: Install dependencies + run: mix deps.get --only test + + - name: Check unused dependencies + run: mix deps.unlock --check-unused + + - name: Remove compiled application files + run: mix clean + + - name: Compile dependencies + run: mix compile + env: + MIX_ENV: test + + - name: Compile & lint dependencies + run: mix compile --warnings-as-errors + env: + MIX_ENV: test + + - name: Run tests + run: | + epmd -daemon + mix test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d2e253b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: elixir -elixir: 1.6.6 -otp_release: 21.3 -matrix: - include: - - elixir: 1.8.2 - otp_release: 21.3 -sudo: false -before_script: - - epmd -daemon - - mix deps.get --only test -script: - - mix test diff --git a/README.md b/README.md index fde300f6..1a297495 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > Distributed PubSub and Presence platform for the Phoenix Framework -[![Build Status](https://api.travis-ci.org/phoenixframework/phoenix_pubsub.svg)](https://travis-ci.org/phoenixframework/phoenix_pubsub) +[![Build Status](https://github.com/phoenixframework/phoenix_pubsub/workflows/CI/badge.svg)](https://github.com/phoenixframework/phoenix_pubsub/actions?query=workflow%3A%22CI%22) ## Usage