Skip to content

Commit 2e345fc

Browse files
committed
Rewrite CI based on Mint
Tests are run in a matrix against a few Elixir and OTP versions. Mint.WebSocket should be able to support Elixir as low as 1.5.5 like Mint has in its CI. The test dependencies on Cowboy and Ranch need OTP 21+ for the new stacktrace syntax so we only test as far back as 1.6.6.
1 parent eb801f3 commit 2e345fc

6 files changed

Lines changed: 106 additions & 195 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 97 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
test:
9+
name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.erlang }})
10+
# We need Ubuntu 18.04 for older OTP versions.
11+
runs-on: ubuntu-18.04
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- erlang: "25.1"
17+
elixir: "1.14"
18+
lint: true
19+
coverage: true
20+
report: true
21+
- erlang: "24.3"
22+
elixir: "1.12"
23+
- erlang: "23.3.1"
24+
elixir: "1.11.4"
25+
- erlang: "21.3"
26+
elixir: "1.6.6"
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
MIX_ENV: test
30+
ECHO_HOST: localhost
31+
FUZZINGSERVER_HOST: localhost
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
- name: Install OTP and Elixir
37+
uses: erlef/setup-elixir@v1
38+
with:
39+
otp-version: ${{matrix.erlang}}
40+
elixir-version: ${{matrix.elixir}}
41+
42+
- name: Cache dependencies
43+
id: cache-deps
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
deps
48+
_build
49+
key: ${{ runner.os }}-mix-otp${{ matrix.erlang }}-elixir${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
50+
51+
- name: Install and compile dependencies
52+
if: steps.cache-deps.outputs.cache-hit != 'true'
53+
run: |
54+
mix deps.get --only test
55+
mix deps.compile
56+
57+
- name: Start docker
58+
run: docker-compose up --detach echo fuzzingserver
59+
60+
- name: Check for unused dependencies
61+
run: mix deps.get && mix deps.unlock --check-unused
62+
if: ${{ matrix.lint && steps.cache-deps.outputs.cache-hit != 'true' }}
63+
64+
- name: Compile with --warnings-as-errors
65+
run: mix compile --warnings-as-errors
66+
if: ${{ matrix.lint }}
67+
68+
- name: Run tests with coverage
69+
run: mix coveralls.github
70+
if: ${{ matrix.coverage }}
71+
72+
- name: Run tests
73+
run: mix test --trace
74+
if: ${{ !matrix.coverage }}
75+
76+
- name: Check mix format
77+
run: mix format --check-formatted
78+
if: ${{ matrix.lint }}
79+
80+
- name: Add seedling favicon to autobahn report
81+
if: github.ref == 'refs/heads/main' && matrix.report
82+
run: ./autobahn/favicon.sh ./autobahn/reports/index.html
83+
84+
- name: Checkout gh-pages branch to ./gh-pages
85+
if: github.ref == 'refs/heads/main' && matrix.report
86+
uses: actions/checkout@v3
87+
with:
88+
ref: gh-pages
89+
path: ./gh-pages
90+
91+
- name: Move autobahn report results
92+
if: github.ref == 'refs/heads/main' && matrix.report
93+
run: mv ./autobahn/reports/* ./gh-pages/
94+
95+
- name: Commit autobahn report to gh-pages branch
96+
if: github.ref == 'refs/heads/main' && matrix.report
97+
run: |
98+
cd ./gh-pages
99+
git config --local user.email "$(git log --format='%ae' HEAD^!)"
100+
git config --local user.name "$(git log --format='%an' HEAD^!)"
101+
git add *.{html,json}
102+
git commit -m "publish Autobahn|Testsuite report" || true
103+
git push

.github/workflows/refresh-dev-cache.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

config/config.exs

Lines changed: 0 additions & 3 deletions
This file was deleted.

mix.exs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule MintWebSocket.MixProject do
77
[
88
app: :mint_web_socket,
99
version: "1.0.1",
10-
elixir: "~> 1.8",
10+
elixir: "~> 1.6",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
erlc_paths: erlc_paths(Mix.env()),
1313
start_permanent: Mix.env() == :prod,
@@ -17,9 +17,7 @@ defmodule MintWebSocket.MixProject do
1717
coveralls: :test,
1818
"coveralls.html": :test,
1919
"coveralls.github": :test,
20-
docs: :dev,
21-
bless: :test,
22-
credo: :test
20+
docs: :dev
2321
],
2422
package: package(),
2523
description: description(),
@@ -43,9 +41,7 @@ defmodule MintWebSocket.MixProject do
4341
{:jason, ">= 0.0.0", only: [:dev, :test]},
4442
{:cowboy, "~> 2.9", only: [:test]},
4543
{:gun, "== 2.0.0-rc.2", only: [:test]},
46-
{:credo, "~> 1.0", only: [:test], runtime: false},
47-
{:excoveralls, "~> 0.14", only: [:test]},
48-
{:bless, "~> 1.0", only: [:test]}
44+
{:excoveralls, "~> 0.14", only: [:test]}
4945
]
5046
end
5147

mix.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
%{
2-
"bless": {:hex, :bless, "1.2.0", "5e8190738dcf2fedcbcee2433b44f0e4629a1b0ce84052e5ba17f8dff48d42bd", [:mix], [], "hexpm", "046692560e401dc33c2bb3223bb3f210c18fafbae24431f0056516bb5c8be805"},
3-
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
42
"castore": {:hex, :castore, "0.1.17", "ba672681de4e51ed8ec1f74ed624d104c0db72742ea1a5e74edbc770c815182f", [:mix], [], "hexpm", "d9844227ed52d26e7519224525cb6868650c272d4a3d327ce3ca5570c12163f9"},
53
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
64
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
75
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
8-
"credo": {:hex, :credo, "1.6.4", "ddd474afb6e8c240313f3a7b0d025cc3213f0d171879429bf8535d7021d9ad78", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c28f910b61e1ff829bffa056ef7293a8db50e87f2c57a9b5c3f57eee124536b7"},
96
"earmark_parser": {:hex, :earmark_parser, "1.4.25", "2024618731c55ebfcc5439d756852ec4e85978a39d0d58593763924d9a15916f", [:mix], [], "hexpm", "56749c5e1c59447f7b7a23ddb235e4b3defe276afc220a6227237f3efe83f51e"},
107
"ex_doc": {:hex, :ex_doc, "0.28.4", "001a0ea6beac2f810f1abc3dbf4b123e9593eaa5f00dd13ded024eae7c523298", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bf85d003dd34911d89c8ddb8bda1a958af3471a274a4c2150a9c01c78ac3f8ed"},
118
"excoveralls": {:hex, :excoveralls, "0.14.4", "295498f1ae47bdc6dce59af9a585c381e1aefc63298d48172efaaa90c3d251db", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e3ab02f2df4c1c7a519728a6f0a747e71d7d6e846020aae338173619217931c1"},
12-
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
139
"gun": {:hex, :gun, "2.0.0-rc.2", "7c489a32dedccb77b6e82d1f3c5a7dadfbfa004ec14e322cdb5e579c438632d2", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "6b9d1eae146410d727140dbf8b404b9631302ecc2066d1d12f22097ad7d254fc"},
1410
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
1511
"hpax": {:hex, :hpax, "0.1.1", "2396c313683ada39e98c20a75a82911592b47e5c24391363343bde74f82396ca", [:mix], [], "hexpm", "0ae7d5a0b04a8a60caf7a39fcf3ec476f35cc2cc16c05abea730d3ce6ac6c826"},

0 commit comments

Comments
 (0)