Skip to content

Commit

Permalink
CI - PG Version (BeaconCMS#598)
Browse files Browse the repository at this point in the history
* CI - PG Version

* Add PG version to name
  • Loading branch information
leandrocp authored Oct 5, 2024
1 parent 9b32b10 commit bf09fb1
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: CI

on:
pull_request:
push:
branches:
- main
paths-ignore:
- 'guides/**'
pull_request:
paths-ignore:
- 'guides/**'

permissions:
contents: write

jobs:
test:
name: "test: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix-version}} | LiveView ${{matrix.phoenix-live-view-version}}"
name: "test: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LiveView ${{matrix.phoenix-live-view}} | PG ${{matrix.postgres}}"

strategy:
fail-fast: false
Expand All @@ -20,25 +24,27 @@ jobs:
# minimum required versions
- otp: "23"
elixir: "1.14.0"
phoenix-version: "1.7.0"
phoenix-live-view-version: "0.20.2"
phoenix: "1.7.0"
phoenix-live-view: "0.20.2"
postgres: '13.0-alpine'

# latest
- otp: "27"
elixir: "1.17"
phoenix-version: "~> 1.7"
phoenix-live-view-version: "~> 0.20"
phoenix: "~> 1.7"
phoenix-live-view: "~> 0.20"
postgres: '16.4-alpine'

env:
MIX_ENV: test
PHOENIX_VERSION: ${{matrix.phoenix-version}}
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view-version}}
PHOENIX_VERSION: ${{matrix.phoenix}}
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view}}

runs-on: ubuntu-20.04

services:
postgres:
image: postgres:13.1
image: postgres:${{matrix.postgres}}
env:
POSTGRES_DB: beacon_test
POSTGRES_USER: postgres
Expand All @@ -49,7 +55,7 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
- 5432/tcp

steps:
- name: Checkout code
Expand All @@ -68,9 +74,9 @@ jobs:
path: |
deps
_build
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix}}-${{ matrix.phoenix-live-view}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix}}-${{ matrix.phoenix-live-view}}-${{ hashFiles('**/mix.lock') }}
- run: mix deps.get --only-test

Expand All @@ -82,7 +88,7 @@ jobs:
run: mix test

quality:
name: "quality: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix-version}} | LiveView ${{matrix.phoenix-live-view-version}}"
name: "quality: OTP ${{matrix.otp}} | Elixir ${{matrix.elixir}} | Phoenix ${{matrix.phoenix}} | LiveView ${{matrix.phoenix-live-view}}"

strategy:
fail-fast: false
Expand All @@ -91,8 +97,8 @@ jobs:
# latest
- otp: "27"
elixir: "1.17"
phoenix-version: "~> 1.7"
phoenix-live-view-version: "~> 0.20"
phoenix: "~> 1.7"
phoenix-live-view: "~> 0.20"

env:
MIX_ENV: dev
Expand All @@ -117,9 +123,9 @@ jobs:
path: |
deps
_build
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
key: mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix}}-${{ matrix.phoenix-live-view}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles('**/mix.lock') }}
mix-${{ env.MIX_ENV }}-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix}}-${{ matrix.phoenix-live-view}}-${{ hashFiles('**/mix.lock') }}
- run: mix deps.get

Expand Down

0 comments on commit bf09fb1

Please sign in to comment.