Skip to content

Commit

Permalink
CI housekeeping
Browse files Browse the repository at this point in the history
List of changes:
- bump GitHub Actions
- fix incorrect workflow triggers on wrong branch
- linting jobs only on Elixir 1.18/OTP 27
- remove unused jobs
- resolve Credo warnings
- support Elixir 1.18/OTP 27 CI matrix
- use short versions in CI matrix where setup/beam to auto expand to
  latest version
  • Loading branch information
kianmeng committed Jan 20, 2025
1 parent 4e6972f commit 10c2bbd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

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

jobs:
check_duplicate_runs:
Expand Down Expand Up @@ -36,20 +36,23 @@ jobs:
fail-fast: false
matrix:
include:
- elixir: "1.14.5"
otp: "24.3.4.17"
- elixir: "1.15.8-otp-25"
otp: "25.3.2.13"
- elixir: "1.16.3-otp-26"
otp: "26.2.5.2"
- elixir: "1.17.2-otp-27"
otp: "27.0.1"
- elixir: "1.14"
otp: "24"
- elixir: "1.15"
otp: "25"
- elixir: "1.16"
otp: "26"
- elixir: "1.17"
otp: "27"
- elixir: "1.18"
otp: "27"
lint: true

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
Expand All @@ -58,7 +61,7 @@ jobs:
otp-version: ${{ matrix.otp }}

- name: Restore deps and _build cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
deps
Expand All @@ -72,7 +75,7 @@ jobs:
run: mkdir -p priv/plts

- name: Restore plts cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: priv/plts
key: plts-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
Expand All @@ -85,9 +88,11 @@ jobs:

- name: Check source code format
run: mix format --check-formatted
if: ${{ matrix.lint }}

- name: Perform source code static analysis
run: mix credo --strict
run: mix credo
if: ${{ matrix.lint }}
env:
MIX_ENV: test

Expand All @@ -105,21 +110,5 @@ jobs:
MIX_ENV: test

- name: Run tests
run: mix coveralls.github --warnings-as-errors
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run dialyzer
run: mix dialyzer
env:
MIX_ENV: test

all_done:
name: Tests done
needs: tests

runs-on: ubuntu-latest

steps:
- name: All done
run: echo '+'
run: mix coveralls --warnings-as-errors
if: ${{ matrix.lint }}
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ defmodule JokenJwks.MixProject do
{:telemetry, "~> 0.4.2 or ~> 1.0"},

# docs
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:ex_doc, ">= 0.0.0", only: [:dev, :test], runtime: false},

# linters & coverage
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
Expand Down

0 comments on commit 10c2bbd

Please sign in to comment.