Skip to content

Commit 7a9c1f1

Browse files
committed
Move over CI upgrades from benchee
* 20.04 runners don't work any more * better windows runner see f.ex. bencheeorg/benchee#464
1 parent 9318be7 commit 7a9c1f1

File tree

1 file changed

+33
-39
lines changed

1 file changed

+33
-39
lines changed

.github/workflows/main.yml

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on: [pull_request, push]
88
jobs:
99
linux:
1010
name: Test on Ubuntu (Elixir ${{ matrix.elixir_version }}, OTP ${{ matrix.otp_version }})
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212

1313
strategy:
1414
matrix:
@@ -20,23 +20,28 @@ jobs:
2020
# We've been using enough of githubs CI resources and our own wait time :)
2121
#
2222
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp
23+
#
24+
# We're also further limited by the support the setup-beam action offers:
25+
# https://github.com/erlef/setup-beam?tab=readme-ov-file#compatibility-between-operating-system-and-erlangotp
2326
include:
24-
# Code should work down to elixir 1.7, but stream_data requires 1.12+ and I don't think it's worth my time to
25-
# be conditionally including the library: https://github.com/whatyouhide/stream_data/blob/main/CHANGELOG.md#v110
26-
- elixir_version: '1.12.3'
27-
otp_version: '23.3'
28-
- elixir_version: '1.13.4'
29-
otp_version: '22.3'
30-
- elixir_version: '1.14.5'
31-
otp_version: '23.3'
32-
- elixir_version: '1.15.7'
27+
- elixir_version: '1.11'
28+
otp_version: '24.3'
29+
- elixir_version: '1.12'
3330
otp_version: '24.3'
34-
- elixir_version: '1.16.3'
31+
- elixir_version: '1.13'
3532
otp_version: '25.3'
36-
- elixir_version: '1.17.3'
33+
- elixir_version: '1.14'
34+
otp_version: '25.3'
35+
- elixir_version: '1.15'
36+
otp_version: '26.2'
37+
- elixir_version: '1.16'
3738
otp_version: '26.2'
38-
- elixir_version: '1.18.1'
39-
otp_version: '27.2'
39+
- elixir_version: '1.17'
40+
otp_version: '27.3'
41+
- elixir_version: '1.18'
42+
otp_version: '27.3'
43+
type_check: true
44+
lint: true
4045

4146
steps:
4247
- name: Checkout
@@ -58,26 +63,27 @@ jobs:
5863
with:
5964
path: tools/plts
6065
key: erlef-${{ runner.os }}-dialyzer-${{ matrix.elixir_version }}-${{ matrix.otp_version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
61-
if: contains(matrix.elixir_version, '1.18')
66+
if: ${{ matrix.type_check }}
6267
- run: mix deps.get
6368
- run: MIX_ENV=test mix compile --warnings-as-errors
6469
- run: mix credo
65-
if: contains(matrix.elixir_version, '1.18')
70+
if: ${{ matrix.lint }}
6671
- name: Check if formatted
67-
if: contains(matrix.elixir_version, '1.18')
72+
if: ${{ matrix.lint }}
6873
run: mix format --check-formatted
6974
- name: Actual Tests
7075
# this will let warnings slip through but I don't wanna replicate all that magic
7176
# right now
7277
run: MIX_ENV=test mix coveralls.github || mix test --failed
7378
# Apparently the one with `!` can't go without the fancy expression syntax
74-
if: ${{ !contains(matrix.elixir_version, '1.18') }}
79+
if: ${{ !matrix.lint }}
80+
# warnings as errors is a form of linting!
7581
- name: Actual Tests WITH warnings as errors
7682
run: MIX_ENV=test mix coveralls.github --warnings-as-errors || mix test --failed
77-
if: contains(matrix.elixir_version, '1.18')
83+
if: ${{ matrix.lint }}
7884
- name: Dialyzer
7985
run: mix dialyzer --halt-exit-status
80-
if: contains(matrix.elixir_version, '1.18')
86+
if: ${{ matrix.type_check }}
8187

8288
macos:
8389
name: Test on MacOS
@@ -104,29 +110,17 @@ jobs:
104110

105111
windows:
106112
name: Test on Windows
107-
runs-on: windows-latest
113+
runs-on: windows-2022
108114

109115
steps:
110116
- name: Checkout
111117
uses: actions/checkout@v3
112-
- name: Restore chocolatey
113-
uses: actions/cache@v3
118+
- name: Setup Elixir
119+
uses: erlef/setup-beam@v1
114120
with:
115-
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
116-
key: ${{ runner.os }}-chocolatey-${{ github.sha }}
117-
restore-keys: |
118-
${{ runner.os }}-chocolatey-
119-
- name: Install Elixir
120-
run: |
121-
choco install elixir --version=1.14.2 --no-progress
122-
set MIX_ENV=test
123-
echo "C:\ProgramData\chocolatey\lib\Elixir\bin;C:\ProgramData\chocolatey\bin;C:\ProgramData\chocolatey\lib\Elixir\tools\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
124-
- name: Build
125-
run: |
126-
echo "$PATH"
127-
mix local.hex --force
128-
mix deps.get
129-
mix local.rebar --force
130-
mix compile --warnings-as-errors
121+
elixir-version: '1.18'
122+
otp-version: '27.3'
123+
- name: Get deps
124+
run: mix deps.get
131125
- name: Test
132126
run: mix test || mix test --failed

0 commit comments

Comments
 (0)