From bf09fb1ff898781d577f46c5514ef013ab43e77d Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sat, 5 Oct 2024 16:04:30 -0400 Subject: [PATCH] CI - PG Version (#598) * CI - PG Version * Add PG version to name --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f5bee13c..08da2045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -49,7 +55,7 @@ jobs: --health-timeout 5s --health-retries 5 ports: - - 5432:5432 + - 5432/tcp steps: - name: Checkout code @@ -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 @@ -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 @@ -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 @@ -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