This repository has been archived by the owner on Sep 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add test GitHub workflow * Add the actual contents of the workflows file... * Run formatting * Update lockfile * Update .github/workflows/test.yml Separate dependencies compilation from app compilation for cleaner output Co-authored-by: Wojtek Mach <wojtekmach@users.noreply.github.com> --------- Co-authored-by: Wojtek Mach <wojtekmach@users.noreply.github.com>
- Loading branch information
1 parent
bc05bc1
commit f01b5e7
Showing
3 changed files
with
67 additions
and
3 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,65 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
otp: "26.2.2" | ||
elixir: "1.16.1" | ||
MIX_ENV: test | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
db: | ||
image: postgres:16.2 | ||
ports: ["5432:5432"] | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Erlang & Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.otp }} | ||
elixir-version: ${{ env.elixir }} | ||
version-type: strict | ||
|
||
- name: Cache Mix | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}- | ||
- name: Install mix dependencies | ||
run: mix deps.get --check-locked | ||
|
||
- name: Check formatting | ||
run: mix format --check-formatted | ||
|
||
- name: Compile dependencies | ||
run: mix deps.compile | ||
|
||
- name: Check warnings | ||
run: mix compile --warnings-as-errors --force | ||
|
||
- name: Setup database | ||
run: mix do ecto.create, ecto.migrate | ||
|
||
- name: Run tests | ||
run: mix test --warnings-as-errors |
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
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