Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hpopp committed Aug 31, 2024
1 parent 804752f commit fe665a8
Showing 1 changed file with 49 additions and 10 deletions.
59 changes: 49 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,68 @@ name: CI

on:
push:
branches: [master]
branches: ["master"]
pull_request:
branches: [master]
branches: ["master"]

jobs:
build:
name: Build and test
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Prettier
run: npm install --global prettier
- name: Run Prettier
run: prettier --check --no-error-on-unmatched-pattern "**/*.{json,md,yml,yaml}"
check:
name: Format/Credo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: "1.17.2"
otp-version: "27.0.1"
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run formatter
run: mix format --check-formatted
- name: Run Credo
run: mix credo
test:
name: Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f
uses: erlef/setup-beam@v1
with:
elixir-version: "1.12.3" # Define the elixir version [required]
otp-version: "24.1" # Define the OTP version [required]
elixir-version: "1.17.2"
otp-version: "27.0.1"
- name: Restore dependencies cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
TERM: xterm
run: mix test

0 comments on commit fe665a8

Please sign in to comment.