Skip to content

Commit

Permalink
Run CI without mix.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
angelikatyborska committed Jul 6, 2024
1 parent b2263ee commit b868dd8
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,38 @@ on:
branches: [ main ]
pull_request:
workflow_dispatch:
schedule:
- cron: '0 4 * * 2,6'

jobs:
test:
name: Text (Elixir ${{matrix.versions.elixir}}, OTP ${{matrix.versions.otp}}, ${{matrix.mix_lock}}, ${{matrix.linting}})
runs-on: ubuntu-20.04
continue-on-error: false
strategy:
fail-fast: false
matrix:
include:
versions:
- elixir: '1.13.2'
otp: '24.1'
current_version: false
linting: 'without_linting'
- elixir: '1.14.0'
otp: '25.0'
current_version: false
linting: 'without_linting'
- elixir: '1.15.0'
otp: '26.0'
current_version: true
linting: 'with_linting'
- elixir: '1.16.0'
otp: '26.2'
current_version: true
linting: 'with_linting'
- elixir: '1.17.0'
otp: '27.0'
current_version: true
linting: 'with_linting'
mix_lock: ['with_mix_lock', 'without_mix_lock']
exclude:
- mix_lock: ${{ github.event.schedule && 'with_mix_lock' }}
- mix_lock: 'without_mix_lock'
linting: 'with_linting'

steps:
- name: Checkout code
Expand All @@ -37,8 +45,8 @@ jobs:
- name: Use Elixir
uses: erlef/setup-beam@a34c98fd51e370b4d4981854aba1eb817ce4e483
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
otp-version: ${{matrix.versions.otp}}
elixir-version: ${{matrix.versions.elixir}}

- name: Set cache key
id: set_cache_key
Expand All @@ -57,8 +65,12 @@ jobs:
path: deps
key: mix-${{ steps.set_cache_key.outputs.cache_key }}-v1

- name: Unlock Mix Dependencies
if: matrix.mix_lock == 'without_mix_lock'
run: mix deps.unlock --all

- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
if: steps.mix-cache.outputs.cache-hit != 'true' || matrix.mix_lock == 'without_mix_lock'
run: mix deps.get

- name: Build Project
Expand Down Expand Up @@ -97,11 +109,11 @@ jobs:

- name: Run Dialyzer
run: mix dialyzer
if: ${{ matrix.current_version }}
if: ${{ matrix.versions.linting == 'with_linting' }}

- name: Run format check
run: mix format --check-formatted
if: ${{ matrix.current_version }}
if: ${{ matrix.versions.linting == 'with_linting' }}

all_tests_passing:
if: ${{ always() }}
Expand Down

0 comments on commit b868dd8

Please sign in to comment.