Skip to content

Commit

Permalink
Fixes issues with annotations and adds tests (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianberlin authored Oct 31, 2023
1 parent eb8320d commit c55650a
Show file tree
Hide file tree
Showing 6 changed files with 675 additions and 163 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
OTP_VERSION: 26.1.1
ELIXIR_VERSION: 1.15.6-otp-26

jobs:
test:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}

- name: Build Cache
uses: actions/cache/restore@v3
id: build-cache
with:
path: _build
key: build-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}

- name: Deps Cache
uses: actions/cache/restore@v3
id: deps-cache
with:
path: deps
key: deps-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}

- name: Install Mix Dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: mix deps.get

- name: Compile
if: steps.build-cache.outputs.cache-hit != 'true'
run: mix compile

- name: Check Formatting
run: mix format --check-formatted

- name: Run Credo
run: mix credo --strict

- name: Run Tests
run: mix lcov

- name: Coverage Reporter
uses: peek-travel/coverage-reporter@cygnus
id: coverage-reporter
if: github.event_name == 'pull_request'
continue-on-error: true
with:
lcov_path: cover/lcov.info
coverage_threshold: 90

- name: Restore PLT cache
uses: actions/cache@v2
id: plt-cache
with:
key: plt-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}
path: priv/plts

- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: MIX_ENV=dev mix dialyzer --plt

- name: Run dialyzer
run: MIX_ENV=dev mix dialyzer --format github

- name: Save Deps Cache
id: deps-cache-save
uses: actions/cache/save@v3
with:
path: deps
key: deps-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}

- name: Save Build Cache
id: build-cache-save
uses: actions/cache/save@v3
with:
path: _build
key: build-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}

- name: Save PLT cache
id: plt-cache-save
uses: actions/cache/save@v3
with:
path: priv/plts
key: plt-${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}
18 changes: 11 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: 'Coverage Reporter'
description: 'Coverage Reporter'
name: "Coverage Reporter"
description: "Coverage Reporter"

inputs:
GITHUB_TOKEN:
description: 'Github token of the repository (automatically created by Github)'
description: "Github token of the repository (automatically created by Github)"
default: ${{ github.token }}
required: false
coverage_threshold:
required: true
description: 'Coverage Threshold'
default: 80
description: "Coverage Threshold"
default: "80"
lcov_path:
required: true
description: LCOV file path. The path may contain wildcards. [Reference](https://hexdocs.pm/elixir/Path.html#wildcard/2)
lcov_path_prefix:
required: false
description: If the path returned on the review summary includes the absolute path, you can use this option to remove the prefix.
default: ""

runs:
using: 'docker'
image: 'Dockerfile'
using: "docker"
image: "Dockerfile"
Loading

0 comments on commit c55650a

Please sign in to comment.