From e9e73b0cb9bf112069c3c777a650862b17380e50 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 11:21:04 +0000 Subject: [PATCH] Use Swift version 5.7 in PR checks The version installed in the latest runner image, 5.7.1, is not yet supported. --- .../__export-file-baseline-information.yml | 4 ++++ .../workflows/__multi-language-autodetect.yml | 19 +++++++++++++++++-- .github/workflows/__swift-autobuild.yml | 3 +++ .github/workflows/__swift-custom-build.yml | 3 +++ .../export-file-baseline-information.yml | 4 ++++ .../checks/multi-language-autodetect.yml | 18 ++++++++++++++++-- pr-checks/checks/swift-autobuild.yml | 3 +++ pr-checks/checks/swift-custom-build.yml | 3 +++ 8 files changed, 53 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index e5981ea52..11ff8aef0 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,6 +42,10 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 956a6280c..0d6b046a1 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,15 +65,23 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 + - uses: ./../action/init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code shell: bash run: ./build.sh + - uses: ./../action/analyze id: analysis + - name: Check language autodetect for all languages excluding Ruby, Swift shell: bash run: | @@ -107,16 +115,23 @@ jobs: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi - - name: Check language autodetect for Ruby, Swift + + - name: Check language autodetect for Ruby if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest') shell: bash - run: |- + run: | RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }} if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Ruby, or created it in the wrong location." exit 1 fi + + - name: Check language autodetect for Swift + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\ + \ == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Swift, or created it in the wrong location." diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 8df545be3..eec8380ad 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,6 +42,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 83a0b84ff..4f2b4d91e 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,6 +48,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 4ce7d7fbf..2b8c43183 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,6 +2,10 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] steps: + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 - uses: ./../action/init with: languages: javascript diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 99f1f6f33..990d20a5a 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,15 +4,23 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 + - uses: ./../action/init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code shell: bash run: ./build.sh + - uses: ./../action/analyze id: analysis + - name: Check language autodetect for all languages excluding Ruby, Swift shell: bash run: | @@ -46,7 +54,8 @@ steps: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi - - name: Check language autodetect for Ruby, Swift + + - name: Check language autodetect for Ruby if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" shell: bash run: | @@ -55,8 +64,13 @@ steps: echo "Did not create a database for Ruby, or created it in the wrong location." exit 1 fi + + - name: Check language autodetect for Swift + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Swift, or created it in the wrong location." exit 1 - fi \ No newline at end of file + fi diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index df36ea990..e6ff9f077 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,6 +6,9 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 3b2e3e889..9177c0675 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,6 +6,9 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift