From 34808f37514bce63cea48281a8a40adff6202007 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Wed, 14 Aug 2024 00:11:31 +0800 Subject: [PATCH] CI housekeeping List of changes: - add min and max Elixir/Erlang matrix - add more CI tasks - bump GitHub actions --- .github/workflows/ci.yml | 55 +++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44d8ac4..5167ca2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,26 +8,47 @@ on: jobs: build: - name: Build and test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + strategy: + matrix: + include: + - pair: + elixir: 1.14.x + otp: 23.x + - pair: + elixir: 1.17.x + otp: 27.x + lint: lint + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Elixir - uses: erlef/setup-beam@v1 + - uses: erlef/setup-beam@v1 with: - otp-version: "25.3" - elixir-version: "1.14" + otp-version: ${{matrix.pair.otp}} + elixir-version: ${{matrix.pair.elixir}} - - name: Restore dependencies cache - uses: actions/cache@v2 + - uses: actions/cache@v4 with: - path: deps - key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} - restore-keys: ${{ runner.os }}-mix- - - - name: Install dependencies - run: mix deps.get - - name: Run tests - run: mix test + path: | + deps + _build + key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}- + + - run: mix deps.get + + - run: mix format --check-formatted + if: ${{ matrix.lint }} + + - run: mix deps.get && mix deps.unlock --check-unused + if: ${{ matrix.lint }} + + - run: mix deps.compile + + - run: mix compile --warnings-as-errors + if: ${{ matrix.lint }} + + - run: mix test