| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + name: "Set up Swift" | ||
| 2 | + description: Performs necessary steps to set up appropriate Swift version. | ||
| 3 | + inputs: | ||
| 4 | + codeql-path: | ||
| 5 | + required: true | ||
| 6 | + runs: | ||
| 7 | + using: "composite" | ||
| 8 | + steps: | ||
| 9 | + - name: Get Swift version | ||
| 10 | + id: get_swift_version | ||
| 11 | + # We don't support Swift on Windows or prior versions of CLI. | ||
| 12 | + if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" | ||
| 13 | + shell: bash | ||
| 14 | + env: | ||
| 15 | + CODEQL_PATH: ${{inputs.codeql-path}} | ||
| 16 | + run: | | ||
| 17 | + if [ $RUNNER_OS = "macOS" ]; then | ||
| 18 | + PLATFORM="osx64" | ||
| 19 | + else # We do not run this step on Windows. | ||
| 20 | + PLATFORM="linux64" | ||
| 21 | + fi | ||
| 22 | + SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')" | ||
| 23 | + VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')" | ||
| 24 | + # Specify 5.7.0, otherwise setup Action will default to latest minor version. | ||
| 25 | + if [ $VERSION = "5.7" ]; then | ||
| 26 | + VERSION="5.7.0" | ||
| 27 | + fi | ||
| 28 | + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT | ||
| 29 | + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 | ||
| 30 | + if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" | ||
| 31 | + with: | ||
| 32 | + swift-version: "${{steps.get_swift_version.outputs.version}}" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments