Noah Settersten commited on
Commit ·
5a4cebf
1
Parent(s): f900aef
ci: Check formatting and code style on GitHub Actions
Browse files- .github/workflows/lint.yml +34 -0
.github/workflows/lint.yml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Create initial workflow based on GitHub's suggestion for Elixir.
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: ["main"]
|
| 6 |
+
pull_request:
|
| 7 |
+
branches: ["main"]
|
| 8 |
+
|
| 9 |
+
jobs:
|
| 10 |
+
lint:
|
| 11 |
+
name: Lint codebase
|
| 12 |
+
runs-on: ubuntu-latest
|
| 13 |
+
steps:
|
| 14 |
+
- uses: actions/checkout@v3
|
| 15 |
+
- name: Set up Elixir
|
| 16 |
+
uses: erlef/setup-beam
|
| 17 |
+
with:
|
| 18 |
+
elixir-version: '1.16.0'
|
| 19 |
+
otp-version: '26.0'
|
| 20 |
+
- name: Cache dependencies
|
| 21 |
+
uses: actions/cach@v3
|
| 22 |
+
with:
|
| 23 |
+
path: deps
|
| 24 |
+
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
|
| 25 |
+
restore-keys: ${{ runner.os }}-mix-
|
| 26 |
+
- name: Install dependencies
|
| 27 |
+
run: mix deps.get
|
| 28 |
+
|
| 29 |
+
- name: Check formatting
|
| 30 |
+
run: mix format --check-formatted
|
| 31 |
+
|
| 32 |
+
- name: Check code style
|
| 33 |
+
run: mix credo
|
| 34 |
+
|