Skip to content

Commit

Permalink
Merge pull request #65 from brainnco/fix/elixir-1.12
Browse files Browse the repository at this point in the history
Handle ExUnit 1.12 events
  • Loading branch information
Danielwsx64 authored Jun 8, 2021
2 parents a472fd3 + b4b191e commit 06e66df
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 58 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ on:
- '*'
jobs:
mix_format:
name: mix format (Elixir 1.10.2 OTP 22.3)
name: mix format (Elixir 1.12.1 OTP 24.0.1)
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: "22.3"
elixir-version: "1.10.2"
otp-version: "24.0.1"
elixir-version: "1.12.1"
- name: Install Dependencies
run: mix deps.get
- name: Run Formatter
run: mix format --check-formatted
mix_credo:
name: mix credo (Elixir 1.10.2 OTP 22.3)
name: mix credo (Elixir 1.12.1 OTP 24.0.1)
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: "22.3"
elixir-version: "1.10.2"
otp-version: "24.0.1"
elixir-version: "1.12.1"
- name: Install Dependencies
run: mix deps.get
- name: Run Credo
Expand All @@ -37,18 +37,20 @@ jobs:
name: mix test (Elixir ${{ matrix.elixir }} OTP ${{ matrix.otp }})
strategy:
matrix:
elixir: ["1.8.2", "1.9.1", "1.10.2"]
elixir: ["1.8.2", "1.9.1", "1.10.2", "1.12.1"]
include:
- elixir: "1.8.2"
otp: "21.3.8"
- elixir: "1.9.1"
otp: "22.1.8"
- elixir: "1.10.2"
otp: "22.3"
- elixir: "1.12.1"
otp: "24.0.1"
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
Expand All @@ -62,10 +64,10 @@ jobs:
needs: [mix_format, mix_credo, mix_test]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: "22.3"
elixir-version: "1.10.2"
otp-version: "24.0.1"
elixir-version: "1.12.1"
- name: Install Dependencies
run: mix deps.get
- name: Run Mix Coverage
Expand All @@ -75,35 +77,35 @@ jobs:
- name: Run codecov script
run: bash <(curl -s https://codecov.io/bash)
mix_check_version:
name: Check version (Elixir 1.10.2 OTP 22.3)
name: Check version (Elixir 1.12.1 OTP 24.0.1)
runs-on: ubuntu-16.04
needs: [mix_format, mix_credo, mix_test]
if: github.ref != 'refs/heads/master' && github.event_name == 'pull_request' && github.base_ref == 'master'
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: "22.3"
elixir-version: "1.10.2"
otp-version: "24.0.1"
elixir-version: "1.12.1"
- name: Install Dependencies
run: mix deps.get
- name: Check version
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix run bin/check_version.exs
mix_publish:
name: Publish (Elixir 1.10.2 OTP 22.3)
name: Publish (Elixir 1.12.1 OTP 24.0.1)
runs-on: ubuntu-16.04
needs: [mix_format, mix_credo, mix_test]
outputs:
version: ${{ steps.output_version.outputs.version }}
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
- uses: actions/setup-elixir@v1.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: "22.3"
elixir-version: "1.10.2"
otp-version: "24.0.1"
elixir-version: "1.12.1"
- name: Install Dependencies
run: mix do deps.get, deps.compile, compile
- name: Publish
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.10.3
erlang 22.1
elixir 1.12.1-otp-24
erlang 24.0.1
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.7.11] - 2021-05-29

### Fixed

- Handle events from ExUnit 1.12

## [0.7.10] - 2021-04-25

### Fixed
Expand Down Expand Up @@ -126,6 +132,7 @@ Improve CI/CD flow:
- Add changelog and Makefile.

[unreleased]: https://github.com/brainnco/xcribe/compare/v0.7.9...master
[0.7.11]: https://github.com/brainnco/xcribe/compare/v0.7.10...v0.7.11
[0.7.9]: https://github.com/brainnco/xcribe/compare/v0.7.8...v0.7.9
[0.7.8]: https://github.com/brainnco/xcribe/compare/v0.7.7...v0.7.8
[0.7.7]: https://github.com/brainnco/xcribe/compare/v0.7.6...v0.7.7
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mix.exs
```elixir
def deps do
[
{:xcribe, "~> 0.7.10"}
{:xcribe, "~> 0.7.11"}
]
end
```
Expand Down
13 changes: 7 additions & 6 deletions lib/xcribe/formatter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ defmodule Xcribe.Formatter do
def init(_config), do: {:ok, nil}

@doc false
def handle_cast({:suite_finished, _run_us, _load_us}, nil) do
def handle_cast({:suite_finished, _run_us, _load_us}, _state), do: suite_finished()
def handle_cast({:suite_finished, _time_us}, _state), do: suite_finished()
def handle_cast(_event, state), do: {:noreply, state}

defp suite_finished do
if Config.active?() do
check_configurations()
|> get_recorded_requests()
Expand All @@ -51,17 +55,14 @@ defmodule Xcribe.Formatter do
|> write()
end

{:noreply, nil}
{:noreply, :ok}
rescue
e in DocException ->
Output.print_doc_exception(e)

{:noreply, nil}
{:noreply, :ok}
end

@doc false
def handle_cast(_event, nil), do: {:noreply, nil}

defp check_configurations do
case Config.check_configurations() do
{:error, errs} -> Output.print_configuration_errors(errs) && :error
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Xcribe.MixProject do
use Mix.Project

@version "0.7.10"
@version "0.7.11"
@description "A lib to generate API documentation from test specs"
@links %{"GitHub" => "https://github.com/brainnco/xcribe"}

Expand Down
Loading

0 comments on commit 06e66df

Please sign in to comment.