Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates to code coverage #3

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 79 additions & 86 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,90 +22,83 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Elixir
uses: erlef/setup-beam@v1.11
id: setup
# - name: Elixir
# uses: erlef/setup-beam@v1.11
# id: setup
# with:
# otp-version: ${{ env.OTP_VERSION_SPEC }}
# elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
# env:
# ImageOS: ubuntu20

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

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

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

# - 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 test --cover

- name: Coverage Reporter
uses: peek-travel/coverage-reporter@partitioned-lcov-results
id: coverage-reporter
if: github.event_name == 'pull_request'
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
env:
ImageOS: ubuntu20

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

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

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

- 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 test --cover --export-coverage default

- name: Run Coverage Reporter
run: |
mix coverage_reporter \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--pull-number ${{ github.event.number }} \
--repository ${{ github.repository }} \
--head-branch ${{ github.head_ref }} \
--commit-sha ${{ github.sha }}

- name: Create Coverage Report Artifact
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: cover/reports/coverage_report.txt

- 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 Build Cache
uses: actions/cache/save@v3
with:
path: _build
key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }}

- name: Save Deps Cache
uses: actions/cache/save@v3
with:
path: deps
key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ 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_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}
lcov_path: cover/lcov.info
coverage_threshold: 80

# - 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 Build Cache
# uses: actions/cache/save@v3
# with:
# path: _build
# key: build-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }}

# - name: Save Deps Cache
# uses: actions/cache/save@v3
# with:
# path: deps
# key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ 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_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 26.0
elixir 1.14.5-otp-26
elixir 1.15.7-otp-26
erlang 26.1
Loading
Loading