-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a51284c
commit b14cada
Showing
4 changed files
with
36 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,20 @@ env: | |
MIX_ENV: test | ||
OTP_VERSION_SPEC: "26.0" | ||
ELIXIR_VERSION_SPEC: "1.15" | ||
CACHE_KEY: | ||
CACHE_RESTORE_KEY: | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Environment | ||
run: | | ||
echo "CACHE_KEY=deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }}" >> $GITHUB_ENV | ||
echo "CACHE_RESTORE_KEY=deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
|
@@ -31,12 +38,13 @@ jobs: | |
env: | ||
ImageOS: ubuntu20 | ||
|
||
- name: Restore Deps Cache | ||
- name: Restore Cache | ||
uses: actions/cache/restore@v3 | ||
id: deps-cache | ||
id: cache | ||
with: | ||
path: deps | ||
key: deps-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }}-${{ hashFiles('mix.lock') }} | ||
path: "*" | ||
key: ${{ env.CACHE_KEY }} | ||
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | ||
|
||
- name: Restore Build Cache | ||
uses: actions/cache/restore@v3 | ||
|
@@ -50,14 +58,12 @@ jobs: | |
id: plt-cache | ||
with: | ||
key: plt-${{ runner.os }}-${{ env.OTP_VERSION_SPEC }}-${{ env.ELIXIR_VERSION_SPEC }} | ||
path: priv/plts | ||
path: 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 | ||
|
@@ -67,16 +73,14 @@ jobs: | |
run: mix credo --strict | ||
|
||
- name: Run Tests | ||
run: mix test --cover --export-coverage default | ||
run: mix test --cover | ||
|
||
- 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: Code Coverage | ||
uses: peek-travel/coverage-reporter@v3 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
lcov_path: cover/**-lcov.info | ||
coverage_threshold: 90 | ||
|
||
- name: Create Coverage Report Artifact | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -85,30 +89,16 @@ jobs: | |
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 | ||
uses: actions/cache/save@v4 | ||
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 }} | ||
path: "*" | ||
key: ${{ env.CACHE_KEY }} | ||
|
||
- name: Create Dependabot Branch | ||
uses: peterjgrainger/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,5 @@ npm-debug.log | |
|
||
priv/plts | ||
|
||
cover | ||
plts |
Oops, something went wrong.