Skip to content

Commit 07712b3

Browse files
committed
Automatically compute the oldest supported SDK.
1 parent 0df45c9 commit 07712b3

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,31 @@ jobs:
1010
strategy:
1111
matrix:
1212
os: [ ubuntu-latest, windows-latest, macos-latest ]
13-
# The versions should contain (at least) the lowest requirement
14-
# and a version that is more up to date.
15-
toit-version: [ v2.0.0-alpha.189, latest ]
16-
include:
17-
- toit-version: v2.0.0-alpha.189
18-
version-name: old
19-
- toit-version: latest
20-
version-name: new
13+
toit-version: [ oldest, latest ]
2114

22-
name: CI - ${{ matrix.os }} - ${{ matrix.version-name }}
15+
name: CI - ${{ matrix.os }} - ${{ matrix.toit-version }}
2316

2417
runs-on: ${{ matrix.os }}
2518

2619
steps:
2720
- uses: actions/checkout@v6
2821

22+
- name: Resolve Toit version
23+
id: toit-version
24+
shell: bash
25+
run: |
26+
if [[ "${{ matrix.toit-version }}" == "oldest" ]]; then
27+
sdk=$(grep -E '^[[:space:]]+sdk:' package.yaml | head -1 \
28+
| sed -E 's/^[[:space:]]+sdk:[[:space:]]*//; s/^\^//' \
29+
| tr -d "\"' ")
30+
echo "version=v$sdk" >> "$GITHUB_OUTPUT"
31+
else
32+
echo "version=latest" >> "$GITHUB_OUTPUT"
33+
fi
34+
2935
- uses: toitlang/action-setup@v1
3036
with:
31-
toit-version: ${{ matrix.toit-version }}
37+
toit-version: ${{ steps.toit-version.outputs.version }}
3238

3339
- name: Install shell completion test dependencies (Linux)
3440
if: runner.os == 'Linux'

0 commit comments

Comments
 (0)