-
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
14395ce
commit 64a9a7f
Showing
2 changed files
with
78 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,76 @@ | ||
name: Elixir CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
paths-ignore: | ||
- "**/README.md" | ||
pull_request: | ||
paths-ignore: | ||
- "**/README.md" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: Build and test with PostgreSQL 14 | ||
runs-on: ubuntu-latest | ||
env: | ||
MIX_ENV: test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: erlef/setup-beam@v1 | ||
with: | ||
version-type: strict | ||
version-file: ".tool-versions" | ||
|
||
- name: Restore dependencies cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-${{ hashFiles('mix.lock') }} | ||
restore-keys: ${{ runner.os }}-mix- | ||
|
||
- name: Restore compiled code | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
_build/*/lib | ||
!_build/*/lib/electric_phoenix | ||
key: ${{ runner.os }}-build-test-${{ hashFiles('mix.lock') }} | ||
|
||
- name: Install dependencies | ||
run: mix deps.get && mix deps.compile | ||
|
||
- name: Save compiled code | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
_build/*/lib | ||
!_build/*/lib/electric_phoenix | ||
key: ${{ runner.os }}-build-test-${{ hashFiles('mix.lock') }} | ||
|
||
- name: Compiles without warnings | ||
run: mix compile --force --all-warnings --warnings-as-errors | ||
|
||
- name: Run tests | ||
run: mix test | ||
formatting: | ||
name: Check formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
version-type: strict | ||
version-file: ".tool-versions" | ||
- name: Cache dependencies | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mixdeps-${{ hashFiles('mix.lock') }} | ||
- run: mix deps.get | ||
- run: mix format --check-formatted |
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,2 @@ | ||
elixir 1.17.2-otp-27 | ||
erlang 27.0.1 |