-
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
4520259
commit c155cdc
Showing
1 changed file
with
81 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Elixir CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/*" | ||
- "**/*.ex" | ||
- "**/*.exs" | ||
- "**/*.eex" | ||
- "mix.lock" | ||
- "coveralls.json" | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/*" | ||
- "**/*.ex" | ||
- "**/*.exs" | ||
- "**/*.eex" | ||
- "mix.lock" | ||
- "coveralls.json" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: '27.0.1' | ||
elixir-version: '1.17.2' | ||
|
||
- name: Restore deps cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-deps-${{ hashFiles('**/mix.lock') }} | ||
${{ runner.os }}-deps | ||
- name: Install package dependencies | ||
run: mix deps.get | ||
|
||
- name: Remove compiled application files | ||
run: mix clean | ||
|
||
- name: Compile dependencies | ||
run: mix compile | ||
env: | ||
MIX_ENV: test | ||
|
||
- name: Run tests | ||
run: mix test --trace | ||
env: | ||
MIX_ENV: test | ||
|
||
- name: Check code coverage | ||
run: mix coveralls | ||
env: | ||
MIX_ENV: test | ||
|
||
- name: Upload coverage to coveralls | ||
run: mix coveralls.github | ||
env: | ||
MIX_ENV: test | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check code formatting | ||
run: mix check | ||
|
||
- name: Run Credo linter | ||
run: mix credo --strict |