From fe7a717eeabb9fd4fba447515f4021f80858084b Mon Sep 17 00:00:00 2001 From: Steffen Deusch Date: Thu, 11 Jul 2024 15:03:57 +0200 Subject: [PATCH] github actions --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++ .travis.yml | 13 ------- README.md | 2 +- test/phoenix/tracker/clock_test.exs | 2 +- 4 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..54c63c23f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: Tests + +on: + push: + pull_request: + branches: + - main + +env: + ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16 + ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16 + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true + +jobs: + tests: + name: Run tests (${{ matrix.image }}) + + strategy: + fail-fast: false + matrix: + include: + - image: 1.7.4-erlang-21.3.8.24-debian-stretch-20210902-slim + - image: 1.17.2-erlang-27.0.1-debian-bookworm-20240701-slim + + runs-on: ubuntu-latest + container: + image: hexpm/elixir:${{ matrix.image }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Hex and Rebar setup + run: | + mix local.hex --force + mix local.rebar --force + + - name: Restore deps and _build cache + uses: actions/cache@v2 + 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: Run tests + run: | + epmd -daemon + mix test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2d2e253b4..000000000 --- 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 fde300f6b..ab5abe6ef 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/actions/workflows/ci.yml/badge.svg)](https://github.com/phoenixframework/phoenix_pubsub/actions/workflows/ci.yml) ## Usage diff --git a/test/phoenix/tracker/clock_test.exs b/test/phoenix/tracker/clock_test.exs index 98e761ba5..2125352fb 100644 --- a/test/phoenix/tracker/clock_test.exs +++ b/test/phoenix/tracker/clock_test.exs @@ -53,6 +53,6 @@ defmodule Phoenix.TrackerClockTest do test "replicas" do assert Clock.replicas(%{}) == [] assert Clock.replicas(%{a: 1}) == [:a] - assert Clock.replicas(%{a: 1, b: 2}) == [:a, :b] + assert Clock.replicas(%{a: 1, b: 2}) |> Enum.sort() == [:a, :b] end end