Skip to content

Commit

Permalink
Pin erlang version to 26.2.1 (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku authored May 22, 2024
1 parent af21aa8 commit f39a82c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
72 changes: 33 additions & 39 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,12 @@ on:
types: [start-ci]

env:
ELIXIR_VERSION: 1.15.7
OTP_VERSION: 26
MIX_ENV: test

jobs:
elixir-deps:
name: Elixir dependencies (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})
name: Elixir dependencies
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- elixir: 1.15.7
otp: 26
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
Expand All @@ -34,10 +27,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup
id: setup-elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
version-file: .tool-versions
version-type: strict
env:
ImageOS: ubuntu20
- name: Retrieve Cached Dependencies
Expand All @@ -48,7 +42,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Install Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -88,10 +82,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup
id: setup-elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
version-file: .tool-versions
version-type: strict
env:
ImageOS: ubuntu20

Expand All @@ -103,7 +98,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Check for Unused Dependencies
run: mix deps.unlock --check-unused
- name: Check Code Format
Expand All @@ -114,14 +109,9 @@ jobs:
run: mix dialyzer

test:
name: Test (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})
name: Test
needs: [elixir-deps, api-bc-check]
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- elixir: 1.15.7
otp: 26
services:
postgres:
image: postgres
Expand Down Expand Up @@ -153,10 +143,11 @@ jobs:
with:
fetch-depth: 0
- name: Setup
id: setup-elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
version-file: .tool-versions
version-type: strict
- name: Retrieve Cached Dependencies
uses: actions/cache@v4
id: mix-cache
Expand All @@ -165,7 +156,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Compile
run: mix compile --warnings-as-errors
- name: Run test
Expand All @@ -182,17 +173,18 @@ jobs:
if: github.ref_name != 'main'
with:
access_token: ${{ github.token }}
- name: Set up Elixir
uses: erlef/setup-beam@v1
if: github.ref_name != 'main'
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Checkout main branch
uses: actions/checkout@v4
if: github.ref_name != 'main'
with:
ref: main
- name: Set up Elixir
id: setup-elixir
uses: erlef/setup-beam@v1
if: github.ref_name != 'main'
with:
version-file: .tool-versions
version-type: strict
- name: Retrieve Cached Dependencies - main branch
uses: actions/cache@v4
id: mix-cache-main
Expand All @@ -202,7 +194,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Install missing dependencies
if: steps.mix-cache-main.outputs.cache-hit != 'true' && github.ref_name != 'main'
run: |
Expand All @@ -228,13 +220,14 @@ jobs:
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout current branch
uses: actions/checkout@v4
- name: Set up Elixir
id: setup-elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Checkout current branch
uses: actions/checkout@v4
version-file: .tool-versions
version-type: strict
- name: Retrieve Cached Dependencies - current branch
uses: actions/cache@v4
id: mix-cache-current
Expand All @@ -243,7 +236,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Generate current openapi.json
run: |
mix openapi.spec.json --start-app=false --spec WandaWeb.Schemas.${{ matrix.version }}.ApiSpec /tmp/specs/current-spec.json
Expand All @@ -260,7 +253,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Generate main openapi.json
run: |
mix openapi.spec.json --start-app=false --spec WandaWeb.Schemas.${{ matrix.version }}.ApiSpec /tmp/specs/main-spec.json
Expand Down Expand Up @@ -373,10 +366,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
id: setup-elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
version-file: .tool-versions
version-type: strict
- name: Retrieve Cached Dependencies
uses: actions/cache@v4
id: mix-cache
Expand All @@ -385,7 +379,7 @@ jobs:
deps
_build/test
priv/plts
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }}
key: ${{ runner.os }}-${{ steps.setup-elixir.outputs.otp-version }}-${{ steps.setup-elixir.outputs.elixir-version }}-${{ hashFiles('mix.lock') }}
- name: Build docs
uses: lee-dohm/generate-elixir-docs@v1
- name: Generate openapi.json
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.15.7-otp-26
erlang 26.1.2
erlang 26.2.1

0 comments on commit f39a82c

Please sign in to comment.