Skip to content

Commit

Permalink
Fix build matrix and separate coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Oct 4, 2024
1 parent 60ce739 commit 3a95863
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ jobs:
strategy:
matrix:
elixir:
- 1.15-25
- 1.15-26
- 1.15-27
- 1.16-25
- 1.16-26
- 1.16-27
- 1.17-25
- 1.17-26
- 1.17-27
env:
Expand Down Expand Up @@ -44,8 +45,8 @@ jobs:
run: mix credo --strict
env:
MIX_ENV: test
- name: Run Tests & Coverage Analysis
run: mix coveralls.github --trace
- name: Run Tests
run: mix test --trace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
Expand All @@ -54,3 +55,36 @@ jobs:
steps:
- name: Pass all checks
run: echo "Tests passed"
coverage:
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- name: Set Elixir and OTP versions
id: elixir-otp
run: |
echo "elixir=$(sed 's/-.*$//' <<< $version)" >> $GITHUB_OUTPUT
echo "otp=$(sed 's/^.*-//' <<< $version)" >> $GITHUB_OUTPUT
env:
version: "1.17-27"
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ steps.elixir-otp.outputs.otp }}
elixir-version: ${{ steps.elixir-otp.outputs.elixir }}
- name: Cache Elixir dependencies
uses: actions/cache@v2
with:
path: |
deps
_build
key: ${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-${{ hashFiles('mix.lock') }}
${{ runner.os }}-deps-${{ steps.elixir-otp.outputs.elixir }}-${{ steps.elixir-otp.outputs.otp }}-
- name: Install Dependencies
run: mix do deps.get, deps.compile
- name: Run Tests & Coverage Analysis
run: mix coveralls.github --trace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build](https://github.com/nulib/edtf_ex/actions/workflows/build.yml/badge.svg)](https://github.com/nulib/edtf_ex/actions/workflows/build.yml)
[![Coverage](https://coveralls.io/repos/github/nulib/edtf_ex/badge.svg?branch=main)](https://coveralls.io/github/nulib/edtf_ex?branch=main)
[![Hex.pm](https://img.shields.io/hexpm/v/edtf_ex.svg)](https://hex.pm/packages/authoritex)
[![Hex.pm](https://img.shields.io/hexpm/v/edtf.svg)](https://hex.pm/packages/edtf)

An Extended Date Time Format (EDTF) / ISO 8601-2 parser and English language rendering
toolkit for Elixir.
Expand Down
2 changes: 1 addition & 1 deletion lib/edtf.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule EDTF do
Parse, validate, and humanize EDTF date strings
"""

alias EDTF.{Date, Interval, Aggregate}
alias EDTF.{Aggregate, Date, Interval}

@doc """
Parse an EDTF date string
Expand Down
6 changes: 4 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ defmodule EDTF.MixProject do
elixir: "~> 1.15",
deps: deps(),
name: "EDTF",
description:
"Extended Date Time Format (EDTF) / ISO 8601-2 parsing and English language rendering",
package: package(),
source_url: @url,
homepage: @url,
Expand Down Expand Up @@ -46,8 +48,8 @@ defmodule EDTF.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:credo, "~> 1.7", only: [:dev, :text], runtime: false},
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.34", only: [:dev, :test, :docs], runtime: false},
{:excoveralls, "~> 0.18", only: [:dev, :test], runtime: false},
{:inflex, "~> 2.1"}
]
Expand Down

0 comments on commit 3a95863

Please sign in to comment.