Skip to content

Commit

Permalink
Enable Github Actions as the new CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed Sep 20, 2022
1 parent 6541642 commit d73f988
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 46 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Elixir

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
# required by test reporter
pull-requests: write
checks: write
issues: write
statuses: write
strategy:
matrix:
include:
- otp-version: 21.3
elixir-version: 1.7.0
- otp-version: 22.2
elixir-version: 1.9.4
- otp-version: 23.2
elixir-version: 1.10.4
- otp-version: 24.3
elixir-version: 1.13.4
- otp-version: 25.0
elixir-version: 1.14.0
check-formatted: true
report-coverage: true
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: deps-${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-elixir-${{ matrix.elixir-version }}-otp-${{ matrix.otp-version }}
- name: Install and compile dependencies
env:
MIX_ENV: test
run: mix do deps.get, deps.compile
- name: Make sure code is formatted
env:
MIX_ENV: test
if: ${{ matrix.check-formatted == true }}
run: mix format --check-formatted
- name: Run tests
env:
MIX_ENV: test
run: mix test --exclude pending
- name: Test Report
env:
MIX_ENV: test
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Mix Tests on Elixir ${{ matrix.elixir-version }} / OTP ${{ matrix.otp-version }}
path: _build/test/lib/sage/test-junit-report.xml
reporter: java-junit
- name: Report code coverage
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.report-coverage == true }}
run: mix coveralls.github
41 changes: 41 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Elixir Dialyzer

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:
name: Build and run Dialyzer
runs-on: ubuntu-latest
strategy:
matrix:
include:
- otp-version: 25.0
elixir-version: 1.14.0
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
with:
elixir-version: ${{ matrix.elixir-version }}
otp-version: ${{ matrix.otp-version }}
- name: Restore Dialyzer PLT cache
uses: actions/cache@v3
with:
path: |
deps
_build
key: plt-${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}-elixir-${{ matrix.elixir-version }}-otp-${{ matrix.otp-version }}
- name: Install and compile dependencies
run: mix do deps.get, deps.compile
- name: Build Dialyzer PLT
run: mix dialyzer --plt
- name: Type check
run: mix dialyzer

43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Sage

[![Build Status](https://travis-ci.org/Nebo15/sage.svg?branch=master)](https://travis-ci.org/Nebo15/sage)
[![Elixir](https://github.com/Nebo15/sage/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Nebo15/sage/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/Nebo15/sage/badge.svg?branch=master)](https://coveralls.io/github/Nebo15/sage?branch=master)
[![Module Version](https://img.shields.io/hexpm/v/sage.svg)](https://hex.pm/packages/sage)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/sage/)
[![Total Download](https://img.shields.io/hexpm/dt/sage.svg)](https://hex.pm/packages/sage)
[![License](https://img.shields.io/hexpm/l/sage.svg)](https://github.com/Nebo15/sage/blob/master/LICENSE.md)
[![Last Updated](https://img.shields.io/github/last-commit/Nebo15/sage.svg)](https://github.com/Nebo15/sage/commits/master)

Sage is a dependency-free implementation of the [Sagas](http://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf) pattern in pure Elixir and provides a set of additional built-in features.

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Sage.Mixfile do
{:ex_doc, ">= 0.0.0", only: [:dev, :test]},
{:excoveralls, ">= 0.7.0", only: [:dev, :test]},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:inch_ex, ">= 0.0.0", only: :test}
{:junit_formatter, "~> 3.3", only: [:test]}
]
end

Expand Down
1 change: 1 addition & 0 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"inch_ex": {:hex, :inch_ex, "2.0.0", "24268a9284a1751f2ceda569cd978e1fa394c977c45c331bb52a405de544f4de", [:mix], [{:bunt, "~> 0.2", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "96d0ec5ecac8cf63142d02f16b7ab7152cf0f0f1a185a80161b758383c9399a8"},
"jason": {:hex, :jason, "1.4.0", "e855647bc964a44e2f67df589ccf49105ae039d4179db7f6271dfd3843dc27e6", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "79a3791085b2a0f743ca04cec0f7be26443738779d09302e01318f97bdb82121"},
"jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm"},
"junit_formatter": {:hex, :junit_formatter, "3.3.1", "c729befb848f1b9571f317d2fefa648e9d4869befc4b2980daca7c1edc468e40", [:mix], [], "hexpm", "761fc5be4b4c15d8ba91a6dafde0b2c2ae6db9da7b8832a55b5a1deb524da72b"},
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Sage.EffectsAgent.start_link()
Sage.CounterAgent.start_link()
ExUnit.configure(formatters: [JUnitFormatter, ExUnit.CLIFormatter])
ExUnit.start(capture_log: true)

0 comments on commit d73f988

Please sign in to comment.