diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 04ca150f..41c3f186 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -70,13 +70,40 @@ jobs: with: terraform_version: "1.5.0" terraform_wrapper: false - - name: Install swift - if: runner.os != 'Windows' - uses: swift-actions/setup-swift@v2 - # Installation of swift screws with installation of ruby on macOS for some reason - - name: Install Xcode Command Line Tools - run: xcode-select --install || true + # - name: Install swift + # if: runner.os != 'Windows' + # uses: swift-actions/setup-swift@v2 + # Installation of swift with the action screws with installation of ruby on macOS for some reason + # We can try again when version 3 of the action is released, where they will also use swiftly + # Until then, we use custom code to install swift. Sourcekit-lsp is installed automatically with swift + - name: Install Swift with swiftly (macOS) if: runner.os == 'macOS' + run: | + echo "=== Installing swiftly on macOS ===" + curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \ + installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \ + ~/.swiftly/bin/swiftly init --quiet-shell-followup && \ + . "${SWIFTLY_HOME_DIR:-$HOME/.swiftly}/env.sh" && \ + hash -r + swiftly install --use 6.1.2 + swiftly use 6.1.2 + echo "~/.swiftly/bin" >> $GITHUB_PATH + echo "Swiftly installed successfully" + - name: Install Swift with swiftly (Ubuntu) + if: runner.os == 'Linux' + run: | + echo "=== Installing swiftly on Ubuntu ===" + curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \ + tar zxf swiftly-$(uname -m).tar.gz && \ + ./swiftly init --quiet-shell-followup && \ + . "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" && \ + hash -r + swiftly install --use 6.1.2 + swiftly use 6.1.2 + sudo apt-get -y install libcurl4-openssl-dev + echo "=== Adding Swift toolchain to PATH ===" + echo "$HOME/.local/share/swiftly/bin" >> $GITHUB_PATH + echo "Swiftly installed successfully!" - name: Install Ruby uses: ruby/setup-ruby@v1 with: