Skip to content

Commit

Permalink
chore: add GHA check
Browse files Browse the repository at this point in the history
  • Loading branch information
Gladear committed Feb 17, 2024
1 parent cb68b23 commit e971f69
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/composite/test-code/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ runs:
shell: bash
run: mix compile --warnings-as-errors

- name: Run dialyzer
run: mix dialyzer --format github

- name: Check formatting
shell: bash
run: mix format --check-formatted
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/composite/test-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ runs:
using: "composite"
steps:
- name: Set up Elixir
id: elixir-install
uses: erlef/setup-beam@3ba5b86a2a6916f8cb0e64dcca30a56732a34bdf
with:
version-file: .tool-versions
Expand All @@ -20,3 +21,33 @@ runs:
- name: Install dependencies
shell: bash
run: mix deps.get --check-locked

# Taken from dialyxir's documentation
# https://github.com/jeremyjh/dialyxir/blob/0091928de1ec01e30f82c50856f2dfe0a8f918ce/docs/github_actions.md
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v3
with:
key: |
plt-${{ runner.os }}-${{ steps.elixir-install.outputs.otp-version }}-${{ steps.elixir-install.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.elixir-install.outputs.otp-version }}-${{ steps.elixir-install.outputs.elixir-version }}-
path: |
priv/plts
# Create dialyzer's PLTs if no cache was found
- name: Create PLTs
if: steps.plt_cache.outputs.cache-hit != 'true'
run: mix dialyzer --plt

# By default, the GitHub Cache action will only save the cache if all steps in the job succeed,
# so we separate the cache restore and save steps in case running dialyzer fails.
- name: Save PLT cache
id: plt_cache_save
uses: actions/cache/save@v3
if: steps.plt_cache.outputs.cache-hit != 'true'
with:
key: |
plt-${{ runner.os }}-${{ steps.elixir-install.outputs.otp-version }}-${{ steps.elixir-install.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
path: |
priv/plts

0 comments on commit e971f69

Please sign in to comment.