diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a63fa2db..0d93bdfc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,17 +10,19 @@ jobs: fail-fast: false matrix: include: - - otp: 23.0 + - otp: 24.0 + elixir: 1.12.1 + lint: true + integration: true + - otp: 23.3 elixir: 1.11.4 lint: true - - otp: 23.0 - elixir: 1.10.3 + - otp: 23.3 + elixir: 1.10.4 + - otp: 22.3 + elixir: 1.10.4 - otp: 22.3 - elixir: 1.10.3 - - otp: 22.1 elixir: 1.9.4 - - otp: 21.3 - elixir: 1.8.2 env: MIX_ENV: test steps: @@ -43,4 +45,21 @@ jobs: run: mix deps.compile - name: Run tests - run: mix test.integration --trace + run: mix test --trace + + - name: Install protoc + if: ${{matrix.integration}} + run: | + wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip + unzip protoc-3.12.3-linux-x86_64.zip + echo "./bin" >> $GITHUB_PATH + + - name: Compile .proto files to Elixir with protoc + if: ${{matrix.integration}} + run: | + make clean + make gen-protos + + - name: Run integration tests + if: ${{matrix.integration}} + run: mix test --only integration diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dec44a2e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -sudo: false -language: elixir -git: - depth: 3 -elixir: - - 1.8 - - 1.9 - - 1.10 -otp_release: - - 21.3 - - 22.3 - - 23.0 -matrix: - exclude: - - elixir: 1.8 - otp_release: 23.0 - - elixir: 1.9 - otp_release: 23.0 -env: - - MIX_ENV=test VERBOSE_TESTS=true -install: - - mix local.rebar --force - - mix local.hex --force - - mix deps.get - - mix eqc.install --mini --force -before_script: - - wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip - - unzip protoc-3.12.3-linux-x86_64.zip - - export PATH=$PATH:$PWD/bin/ -script: - - mix test - - mix test.integration - - mix hex.build - # Only run for latest version - - '[[ "$TRAVIS_ELIXIR_VERSION" =~ 1.[8-9] ]] || mix format --check-formatted' diff --git a/mix.exs b/mix.exs index 4e0cdd1b..cf873f64 100644 --- a/mix.exs +++ b/mix.exs @@ -17,8 +17,6 @@ defmodule Protobuf.Mixfile do escript: escript(), description: description(), package: package(), - aliases: aliases(), - preferred_cli_env: ["test.integration": :test], docs: docs() ] end @@ -69,22 +67,4 @@ defmodule Protobuf.Mixfile do source_ref: "v#{@version}" ] end - - defp aliases do - ["test.integration": &run_integration_tests/1] - end - - defp run_integration_tests(args) do - IO.puts("==> make clean") - Mix.shell().cmd("make clean") - - IO.puts("==> make gen-protos") - Mix.shell().cmd("make gen-protos") - - args = ["--only", "integration" | args] - args = if IO.ANSI.enabled?(), do: ["--color" | args], else: ["--no-color" | args] - - IO.puts("==> mix test #{Enum.join(args, " ")}") - Mix.Task.run("test", args) - end end