-
Notifications
You must be signed in to change notification settings - Fork 28
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
Mikalai Seva
committed
Oct 19, 2023
1 parent
3defe93
commit b652c61
Showing
1 changed file
with
16 additions
and
5 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 |
---|---|---|
@@ -1,29 +1,40 @@ | ||
on: [push, pull_request] | ||
name: Runs on master branch or on open pull requests that are ready for review | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
env: | ||
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | ||
BRANCH: ${{ github.event_name == 'pull_request' && format('refs/heads/{0}', github.event.pull_request.head.ref) || github.ref }} | ||
|
||
jobs: | ||
test: | ||
# This condition ensures that this job will not run on pull requests in draft state | ||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, ubuntu-22.04] | ||
otp: [24, 25, 26] | ||
elixir: [1.15] | ||
check_formatted: true | ||
check_style: true | ||
runs-on: ${{matrix.os}} | ||
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}} (${{matrix.os}}) | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{env.BRANCH}} | ||
- uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{matrix.otp}} | ||
elixir-version: ${{matrix.elixir}} | ||
- name: Install Dependencies | ||
run: mix deps.get | ||
- name: Check formatting | ||
if: matrix.check_formatted | ||
run: mix format --check-formatted | ||
- name: Check style | ||
if: matrix.check_style | ||
run: mix credo --format flycheck | ||
- name: Compile project | ||
run: mix compile --warnings-as-errors | ||
|