-
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.
build(CI/CD): Added elixir_ci.yml 'Build and test' job for Github Act…
…ions
- Loading branch information
1 parent
77f89e6
commit 45b92d5
Showing
2 changed files
with
82 additions
and
1 deletion.
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,73 @@ | ||
# book_my_gigs_test/.github/workflows/elixir_ci.yml | ||
name: Elixir CI | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
env: | ||
MIX_ENV: test | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
elixir: [1.15.2] | ||
otp: [22.2.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Elixir | ||
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
|
||
- name: Retrieve mix dependencies | ||
uses: actions/cache@v3 | ||
id: mix-cache | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | ||
restore-keys: ${{ runner.os }}-mix- | ||
|
||
- name: Install mix dependencies | ||
if: steps.mix-cache.outputs.cache-hit != 'true' | ||
run: | | ||
mix local.rebar --force | ||
mix local.hex --force | ||
mix deps.get | ||
- name: Check formatting | ||
run: mix format --check-formatted | ||
|
||
- name: Run Credo | ||
run: mix credo | ||
|
||
- name: Retrieve PLT Cache | ||
uses: actions/cache@v3 | ||
id: plt-cache | ||
with: | ||
path: priv/plts | ||
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-$${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock'))}} | ||
|
||
- name: Create PLTs | ||
if: steps.plt-cache.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p prv/plts | ||
mix dialyzer --plt | ||
- name: Run Dialyzer | ||
run: mix dialyzer --no-check --halt-exit-status | ||
|
||
- name: Run tests | ||
run: mix test |
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