-
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
d87bc0e
commit d34eb21
Showing
1 changed file
with
60 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,60 @@ | ||
name: Main branch | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
pull_request: | ||
branches: | ||
- "*" | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
MIX_ENV: test | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
elixir-version: ['1.17.3'] | ||
otp-version: ['27.1', '25.2.3'] | ||
mix-env: ['prod', 'test'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
elixir-version: ${{ matrix.elixir-version }} # [Required] Define the Elixir version | ||
otp-version: ${{ matrix.otp-version }} # [Required] Define the Erlang/OTP version | ||
|
||
- name: Restore dependencies cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: ${{ runner.os }}-mix- | ||
|
||
- name: Setup just | ||
run: sudo snap install --edge just --classic | ||
shell: bash | ||
|
||
- name: Get dependencies | ||
run: | | ||
export MIX_ENV=${{ matrix.mix-env }} | ||
mix deps.get | ||
shell: bash | ||
|
||
- name: Compile package | ||
run: | | ||
export MIX_ENV=${{ matrix.mix-env }} | ||
mix compile | ||
shell: bash |