From 07712b3136f6380012aa7d52dfb4c72cf5ff6d04 Mon Sep 17 00:00:00 2001 From: Florian Loitsch Date: Mon, 4 May 2026 11:11:25 +0200 Subject: [PATCH] Automatically compute the oldest supported SDK. --- .github/workflows/ci.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dcdc7f..46feee1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,25 +10,31 @@ jobs: strategy: matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] - # The versions should contain (at least) the lowest requirement - # and a version that is more up to date. - toit-version: [ v2.0.0-alpha.189, latest ] - include: - - toit-version: v2.0.0-alpha.189 - version-name: old - - toit-version: latest - version-name: new + toit-version: [ oldest, latest ] - name: CI - ${{ matrix.os }} - ${{ matrix.version-name }} + name: CI - ${{ matrix.os }} - ${{ matrix.toit-version }} runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 + - name: Resolve Toit version + id: toit-version + shell: bash + run: | + if [[ "${{ matrix.toit-version }}" == "oldest" ]]; then + sdk=$(grep -E '^[[:space:]]+sdk:' package.yaml | head -1 \ + | sed -E 's/^[[:space:]]+sdk:[[:space:]]*//; s/^\^//' \ + | tr -d "\"' ") + echo "version=v$sdk" >> "$GITHUB_OUTPUT" + else + echo "version=latest" >> "$GITHUB_OUTPUT" + fi + - uses: toitlang/action-setup@v1 with: - toit-version: ${{ matrix.toit-version }} + toit-version: ${{ steps.toit-version.outputs.version }} - name: Install shell completion test dependencies (Linux) if: runner.os == 'Linux'