Skip to content

Commit

Permalink
Merge pull request #478 from woylie/update-workflow
Browse files Browse the repository at this point in the history
update CI workflow
  • Loading branch information
woylie authored Jul 6, 2024
2 parents 6bae714 + 0d26c89 commit 971d2d0
Showing 1 changed file with 48 additions and 10 deletions.
58 changes: 48 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,59 @@ on:
- main

jobs:
test-coverage:
runs-on: ubuntu-22.04
name: Test Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
id: beam
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Restore dependencies and build cache
uses: actions/cache@v4
with:
path: |
_build
deps
key: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-mix-${{ hashFiles('mix.lock') }}
restore-keys: ${{ runner.os }}-otp-${{ steps.beam.outputs.otp-version }}-elixir-${{ steps.beam.outputs.elixir-version }}-
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile
run: mix compile --warnings-as-errors
- name: Run Tests
run: mix coveralls.json --warnings-as-errors
- uses: codecov/codecov-action@v4
with:
files: ./cover/excoveralls.json

tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
include:
- { elixir: 1.13, otp: 22 }
- { elixir: 1.13, otp: 23 }
- { elixir: 1.13, otp: 24 }
- { elixir: 1.14, otp: 23 }
- { elixir: 1.14, otp: 24 }
- { elixir: 1.14, otp: 25 }
- { elixir: 1.15, otp: 24 }
Expand All @@ -36,7 +79,6 @@ jobs:
- { elixir: 1.17, otp: 27 }
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

services:
postgres:
image: postgres:12-alpine
Expand All @@ -50,7 +92,6 @@ jobs:
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
Expand All @@ -72,10 +113,7 @@ jobs:
mix local.hex --force
mix deps.get
- name: Run Tests
run: mix coveralls.json
- uses: codecov/codecov-action@v4
with:
files: ./cover/excoveralls.json
run: mix test

matrix-results:
if: ${{ always() }}
Expand Down

0 comments on commit 971d2d0

Please sign in to comment.