From 83b668faae27c0c428733a8c649da99d777276be Mon Sep 17 00:00:00 2001 From: herlandro Date: Tue, 17 Sep 2024 09:14:06 +0100 Subject: [PATCH] Re-enabled Linux tests with Swift 5.5 installation --- .github/workflows/tests.yml | 52 ++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 52e519ade..e962e8a02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,20 +19,48 @@ jobs: steps: - uses: actions/checkout@v3 + + # Select Xcode 15.3 - name: Select Xcode 15.3 run: sudo xcode-select -s /Applications/Xcode_15.3.app + + # Verify that the correct Swift version (5.5 or higher) is installed + - name: Verify Swift version + run: | + swift --version + if ! swift --version | grep -q "5.5"; then + echo "Error: Swift 5.5 is required, but a different version is installed." + exit 1 + fi + + # Run tests in the selected environment - name: Run Tests run: CI=1 ./scripts/all-tests.sh "${{ matrix.environment }}" - # We're having some issues with the Linux tests, so we're disabling them for now. - # Hopefully we'll be able to fix and re-enable them soon. - # Even more hopefully that I won't git blame this comment in the future and see it was 5 years ago :) - - # linux: - # name: "Test (Linux)" - # runs-on: ubuntu-latest - - # steps: - # - uses: actions/checkout@v3 - # - name: Run tests - # run: CI=1 ./scripts/all-tests.sh "Unix" \ No newline at end of file + # Re-enabled Linux tests with Swift 5.5 installation + linux: + name: "Test (Linux)" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + # Install Swift 5.5 in the Linux environment + - name: Install Swift 5.5 + run: | + sudo apt-get update + sudo apt-get install -y curl libssl-dev + git clone https://github.com/kylef/swiftenv.git ~/.swiftenv + echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bashrc + echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bashrc + echo 'eval "$(swiftenv init -)"' >> ~/.bashrc + export SWIFTENV_ROOT="$HOME/.swiftenv" + export PATH="$SWIFTENV_ROOT/bin:$PATH" + eval "$(swiftenv init -)" + swiftenv install 5.5 + swiftenv global 5.5 + swift --version + + # Run tests in the Unix/Linux environment + - name: Run tests + run: CI=1 ./scripts/all-tests.sh "Unix"