From 2474e3177d8e82e0490121b29453cd1cad28774c Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 8 Dec 2022 09:42:14 +0100 Subject: [PATCH 01/22] Unconditionally setup Swift 5.7.1 --- .github/workflows/__export-file-baseline-information.yml | 6 +++--- .github/workflows/__multi-language-autodetect.yml | 8 +++++--- .github/workflows/__swift-autobuild.yml | 4 +--- .github/workflows/__swift-custom-build.yml | 8 +++++--- pr-checks/checks/export-file-baseline-information.yml | 6 +++--- pr-checks/checks/multi-language-autodetect.yml | 6 +----- pr-checks/checks/swift-autobuild.yml | 4 +--- pr-checks/checks/swift-custom-build.yml | 7 ++----- 8 files changed, 21 insertions(+), 28 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 9be43389a2..06fd5016c6 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -43,10 +43,10 @@ jobs: with: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Windows doesn't support Swift, and only macOS latest and nightly-latest support Swift 5.7.1. - if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version == 'cached') + # Windows doesn't support Swift + if: runner.os != 'Windows with: - swift-version: 5.7.0 + swift-version: 5.7.1 - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 3525d5d38e..a411f73d2d 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -45,6 +45,10 @@ jobs: version: latest - os: macos-latest version: latest + - os: ubuntu-latest + version: nightly-latest + - os: macos-latest + version: nightly-latest name: Multi-language repository timeout-minutes: 45 runs-on: ${{ matrix.os }} @@ -62,10 +66,8 @@ jobs: with: go-version: ^1.13.1 - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: 5.7.0 + swift-version: 5.7.1 - uses: ./../action/init with: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index f641dd4265..89b8109fce 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -43,10 +43,8 @@ jobs: with: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: 5.7.0 + swift-version: 5.7.1 - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 7d7c151868..62e4b462b5 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -33,6 +33,10 @@ jobs: version: cached - os: macos-latest version: cached + - os: ubuntu-latest + version: nightly-latest + - os: macos-latest + version: nightly-latest name: Swift analysis using a custom build command timeout-minutes: 45 runs-on: ${{ matrix.os }} @@ -45,10 +49,8 @@ jobs: with: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: 5.7.0 + swift-version: 5.7.1 - 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 c66e8dd142..a31aaf26fb 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -3,10 +3,10 @@ description: "Tests that file baseline information is exported when the feature versions: ["nightly-latest"] steps: - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Windows doesn't support Swift, and only macOS latest and nightly-latest support Swift 5.7.1. - if: runner.os == 'Linux' || (runner.os == 'macOS' && matrix.version == 'cached') + # Windows doesn't support Swift + if: runner.os != 'Windows with: - swift-version: "5.7.0" + swift-version: "5.7.1" - 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 3832278aab..3e006b03fc 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -1,16 +1,12 @@ name: "Multi-language repository" description: "An end-to-end integration test of a multi-language repository using automatic language detection" -# Temporarily exclude nightly-latest to unblock release -versions: ["stable-20211005", "stable-20220120", "stable-20220401", "cached", "latest"] operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: "5.7.0" + swift-version: "5.7.1" - uses: ./../action/init with: diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index b79edd5b34..a24dc8f943 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -7,10 +7,8 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: "5.7.0" + swift-version: "5.7.1" - 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 733d9ad26a..80b12132e0 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -1,17 +1,14 @@ name: "Swift analysis using a custom build command" description: "Tests creation of a Swift database using custom build" -# Temporarily exclude nightly-latest to unblock release -versions: ["latest", "cached"] +versions: ["latest", "cached", "nightly-latest"] operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Only macOS latest and nightly-latest support Swift 5.7.1 - if: runner.os == 'Linux' || matrix.version == 'cached' with: - swift-version: "5.7.0" + swift-version: "5.7.1" - uses: ./../action/init with: languages: swift From 4d8bc9a7533519ba11d97e735b127269de513388 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 8 Dec 2022 17:44:44 +0100 Subject: [PATCH 02/22] Set up Swift version from extractor --- .../workflows/__export-file-baseline-information.yml | 12 +++++++++--- .github/workflows/__multi-language-autodetect.yml | 9 ++++++++- .github/workflows/__swift-autobuild.yml | 8 +++++++- .github/workflows/__swift-custom-build.yml | 8 +++++++- .../checks/export-file-baseline-information.yml | 12 +++++++++--- pr-checks/checks/multi-language-autodetect.yml | 9 ++++++++- pr-checks/checks/swift-autobuild.yml | 8 +++++++- pr-checks/checks/swift-custom-build.yml | 8 +++++++- 8 files changed, 62 insertions(+), 12 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 06fd5016c6..ed19b26608 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,11 +42,17 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Windows doesn't support Swift - if: runner.os != 'Windows + # We don't support Swift on Windows + if: runner.os != 'Windows' with: - swift-version: 5.7.1 + swift-version: ${{steps.get_swift_version.outputs.version}} - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index a411f73d2d..32b0601b6f 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,9 +65,16 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: 5.7.1 + swift-version: ${{steps.get_swift_version.outputs.version}} - uses: ./../action/init with: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 89b8109fce..bd8579cd08 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,9 +42,15 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: 5.7.1 + swift-version: ${{steps.get_swift_version.outputs.version}} - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 62e4b462b5..809a98561f 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,9 +48,15 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: 5.7.1 + swift-version: ${{steps.get_swift_version.outputs.version}} - 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 a31aaf26fb..76ca165f21 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,11 +2,17 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] steps: + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # Windows doesn't support Swift - if: runner.os != 'Windows + # We don't support Swift on Windows + if: runner.os != 'Windows' with: - swift-version: "5.7.1" + swift-version: "${{steps.get_swift_version.outputs.version}}" - 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 3e006b03fc..306d68c29f 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,9 +4,16 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "5.7.1" + swift-version: "${{steps.get_swift_version.outputs.version}}" - uses: ./../action/init with: diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index a24dc8f943..500d48670a 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,9 +6,15 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "5.7.1" + swift-version: "${{steps.get_swift_version.outputs.version}}" - 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 80b12132e0..c743f4a7b5 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,9 +6,15 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "5.7.1" + swift-version: "${{steps.get_swift_version.outputs.version}}" - uses: ./../action/init with: languages: swift From 50fd9ed06cc87d936ffa2ecca674cd4473656500 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Wed, 14 Dec 2022 14:00:59 -0800 Subject: [PATCH 03/22] Always setup 5.7.1, stop testing cached for Swift --- .../__export-file-baseline-information.yml | 8 +------- .github/workflows/__multi-language-autodetect.yml | 13 +++---------- .github/workflows/__swift-autobuild.yml | 10 +--------- .github/workflows/__swift-custom-build.yml | 12 +----------- .../checks/export-file-baseline-information.yml | 8 +------- pr-checks/checks/multi-language-autodetect.yml | 11 ++--------- pr-checks/checks/swift-autobuild.yml | 10 ++-------- pr-checks/checks/swift-custom-build.yml | 10 ++-------- 8 files changed, 13 insertions(+), 69 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index ed19b26608..d092f32aaa 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,17 +42,11 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 # We don't support Swift on Windows if: runner.os != 'Windows' with: - swift-version: ${{steps.get_swift_version.outputs.version}} + swift-version: 5.7.1 - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 32b0601b6f..dcd47dd44b 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,16 +65,9 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: ${{steps.get_swift_version.outputs.version}} + swift-version: 5.7.1 - uses: ./../action/init with: @@ -134,8 +127,8 @@ jobs: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\ - \ == 'latest' || matrix.version == 'nightly-latest')" + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'latest' || matrix.version\ + \ == 'nightly-latest')" shell: bash run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index bd8579cd08..f2469bbbd0 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -27,8 +27,6 @@ jobs: include: - os: macos-latest version: latest - - os: macos-latest - version: cached - os: macos-latest version: nightly-latest name: Swift analysis using autobuild @@ -42,15 +40,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: ${{steps.get_swift_version.outputs.version}} + swift-version: 5.7.1 - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 809a98561f..34d03ae697 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -29,10 +29,6 @@ jobs: version: latest - os: macos-latest version: latest - - os: ubuntu-latest - version: cached - - os: macos-latest - version: cached - os: ubuntu-latest version: nightly-latest - os: macos-latest @@ -48,15 +44,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: ${{steps.get_swift_version.outputs.version}} + swift-version: 5.7.1 - 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 76ca165f21..69aa4b01ac 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,17 +2,11 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] steps: - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 # We don't support Swift on Windows if: runner.os != 'Windows' with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + swift-version: "5.7.1" - 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 306d68c29f..4e38db5065 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,16 +4,9 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + swift-version: "5.7.1" - uses: ./../action/init with: @@ -72,7 +65,7 @@ steps: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'latest' || matrix.version == 'nightly-latest')" shell: bash run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 500d48670a..79b385e756 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -1,20 +1,14 @@ name: "Swift analysis using autobuild" description: "Tests creation of a Swift database using autobuild" -versions: ["latest", "cached", "nightly-latest"] +versions: ["latest", "nightly-latest"] # Swift autobuilder is only supported on MacOS for private beta operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + swift-version: "5.7.1" - 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 c743f4a7b5..ccc31571fd 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -1,20 +1,14 @@ name: "Swift analysis using a custom build command" description: "Tests creation of a Swift database using custom build" -versions: ["latest", "cached", "nightly-latest"] +versions: ["latest", "nightly-latest"] operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - - name: Get Swift version - id: get_swift_version - shell: bash - run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + swift-version: "5.7.1" - uses: ./../action/init with: languages: swift From 31aec7e54424d063089ed1c9acc7235ccd292604 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 10:14:40 -0800 Subject: [PATCH 04/22] Set up Swift version extractor declares after `init` --- .../__export-file-baseline-information.yml | 16 +++++++++++----- .../workflows/__multi-language-autodetect.yml | 15 +++++++++++---- .github/workflows/__swift-autobuild.yml | 12 +++++++++--- .github/workflows/__swift-custom-build.yml | 12 +++++++++--- .../checks/export-file-baseline-information.yml | 16 +++++++++++----- pr-checks/checks/multi-language-autodetect.yml | 15 +++++++++++---- pr-checks/checks/swift-autobuild.yml | 12 +++++++++--- pr-checks/checks/swift-custom-build.yml | 12 +++++++++--- 8 files changed, 80 insertions(+), 30 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index d092f32aaa..8505728633 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,11 +42,6 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # We don't support Swift on Windows - if: runner.os != 'Windows' - with: - swift-version: 5.7.1 - uses: ./../action/init with: languages: javascript @@ -54,6 +49,17 @@ jobs: env: CODEQL_FILE_BASELINE_INFORMATION: true CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + # We don't support Swift on Windows + if: runner.os != 'Windows' + with: + swift-version: ${{steps.get_swift_version.outputs.version}} - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index dcd47dd44b..a2276da7e7 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,15 +65,22 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: 5.7.1 - - uses: ./../action/init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: ${{steps.get_swift_version.outputs.version}} + - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index f2469bbbd0..e47aa8b720 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -40,13 +40,19 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: 5.7.1 - uses: ./../action/init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: ${{steps.get_swift_version.outputs.version}} - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 34d03ae697..1f7f0fba87 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -44,13 +44,19 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: 5.7.1 - uses: ./../action/init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: ${{steps.get_swift_version.outputs.version}} - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 69aa4b01ac..7871c805bd 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,11 +2,6 @@ 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@194625b58a582570f61cc707c3b558086c26b723 - # We don't support Swift on Windows - if: runner.os != 'Windows' - with: - swift-version: "5.7.1" - uses: ./../action/init with: languages: javascript @@ -14,6 +9,17 @@ steps: env: CODEQL_FILE_BASELINE_INFORMATION: true CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + # We don't support Swift on Windows + if: runner.os != 'Windows' + with: + swift-version: "${{steps.get_swift_version.outputs.version}}" - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 4e38db5065..b20663d35f 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,15 +4,22 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: "5.7.1" - - uses: ./../action/init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: "${{steps.get_swift_version.outputs.version}}" + - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 79b385e756..d8b2cadf23 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,13 +6,19 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: "5.7.1" - uses: ./../action/init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: "${{steps.get_swift_version.outputs.version}}" - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index ccc31571fd..47ca9059b0 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,13 +6,19 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - with: - swift-version: "5.7.1" - uses: ./../action/init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Get Swift version + id: get_swift_version + shell: bash + run: | + codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + with: + swift-version: "${{steps.get_swift_version.outputs.version}}" - name: Build code shell: bash run: ./build.sh From 20b2d99dd62d68a9d036c8cd2b202dd655814dcd Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 16:57:46 -0800 Subject: [PATCH 05/22] Update CodeQL Path in PR checks --- .github/workflows/__export-file-baseline-information.yml | 9 +++++++-- .github/workflows/__multi-language-autodetect.yml | 6 +++++- .github/workflows/__swift-autobuild.yml | 6 +++++- .github/workflows/__swift-custom-build.yml | 6 +++++- pr-checks/checks/export-file-baseline-information.yml | 9 +++++++-- pr-checks/checks/multi-language-autodetect.yml | 6 +++++- pr-checks/checks/swift-autobuild.yml | 6 +++++- pr-checks/checks/swift-custom-build.yml | 6 +++++- 8 files changed, 44 insertions(+), 10 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 8505728633..04ecdff342 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -43,6 +43,7 @@ jobs: with: version: ${{ matrix.version }} - uses: ./../action/init + id: init with: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} @@ -51,12 +52,16 @@ jobs: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Get Swift version id: get_swift_version + # We don't support Swift on Windows + if: runner.os != 'Windows' shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # We don't support Swift on Windows if: runner.os != 'Windows' with: swift-version: ${{steps.get_swift_version.outputs.version}} diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index a2276da7e7..ac2d3c1502 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -66,6 +66,7 @@ jobs: with: go-version: ^1.13.1 - uses: ./../action/init + id: init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} @@ -73,8 +74,11 @@ jobs: - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index e47aa8b720..5da4178f78 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -41,14 +41,18 @@ jobs: with: version: ${{ matrix.version }} - uses: ./../action/init + id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 1f7f0fba87..bf901b009e 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -45,14 +45,18 @@ jobs: with: version: ${{ matrix.version }} - uses: ./../action/init + id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 7871c805bd..2826360557 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -3,6 +3,7 @@ description: "Tests that file baseline information is exported when the feature versions: ["nightly-latest"] steps: - uses: ./../action/init + id: init with: languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} @@ -11,12 +12,16 @@ steps: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Get Swift version id: get_swift_version + # We don't support Swift on Windows + if: runner.os != 'Windows' shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - # We don't support Swift on Windows if: runner.os != 'Windows' with: swift-version: "${{steps.get_swift_version.outputs.version}}" diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index b20663d35f..b797b14f83 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -5,6 +5,7 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - uses: ./../action/init + id: init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} @@ -12,8 +13,11 @@ steps: - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index d8b2cadf23..6ad7456b29 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -7,14 +7,18 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: - uses: ./../action/init + id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 47ca9059b0..8272853e1d 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -7,14 +7,18 @@ env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - uses: ./../action/init + id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - name: Get Swift version id: get_swift_version shell: bash + env: + CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - codeql/experimental/swift/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: From bf7b57afdea66499aea3e99665b182fed1e768ec Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 17:24:02 -0800 Subject: [PATCH 06/22] Replace checks for cached --- .github/workflows/__multi-language-autodetect.yml | 4 ++-- .github/workflows/__swift-autobuild.yml | 2 ++ .github/workflows/__swift-custom-build.yml | 4 ++++ pr-checks/checks/multi-language-autodetect.yml | 2 +- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index ac2d3c1502..7f39a5fac2 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -138,8 +138,8 @@ jobs: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'latest' || matrix.version\ - \ == 'nightly-latest')" + 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 }} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 5da4178f78..7c1e1f3459 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -27,6 +27,8 @@ jobs: include: - os: macos-latest version: latest + - os: macos-latest + version: cached - os: macos-latest version: nightly-latest name: Swift analysis using autobuild diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index bf901b009e..e74c80a7ba 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -29,6 +29,10 @@ jobs: version: latest - os: macos-latest version: latest + - os: ubuntu-latest + version: cached + - os: macos-latest + version: cached - os: ubuntu-latest version: nightly-latest - os: macos-latest diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index b797b14f83..87cb65f62b 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -76,7 +76,7 @@ steps: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'latest' || matrix.version == 'nightly-latest')" + 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 }} diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 6ad7456b29..c87e65c80b 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -1,6 +1,6 @@ name: "Swift analysis using autobuild" description: "Tests creation of a Swift database using autobuild" -versions: ["latest", "nightly-latest"] +versions: ["latest", "cached", "nightly-latest"] # Swift autobuilder is only supported on MacOS for private beta operatingSystems: ["macos"] env: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 8272853e1d..e8817bd150 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -1,6 +1,6 @@ name: "Swift analysis using a custom build command" description: "Tests creation of a Swift database using custom build" -versions: ["latest", "nightly-latest"] +versions: ["latest", "cached", "nightly-latest"] operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" From f98790de4041bd716e2b68509330cdd217cc2499 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 17:27:40 -0800 Subject: [PATCH 07/22] Update variable assignment --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__multi-language-autodetect.yml | 2 +- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 2 +- pr-checks/checks/export-file-baseline-information.yml | 2 +- pr-checks/checks/multi-language-autodetect.yml | 2 +- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 04ecdff342..2c01104e6f 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -58,7 +58,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 7f39a5fac2..e6e99d1a5e 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -77,7 +77,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 7c1e1f3459..b7dadba9df 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -53,7 +53,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index e74c80a7ba..041e0d1bb7 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,7 +59,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=`"$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]'` $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 2826360557..69319169d1 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -18,7 +18,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 87cb65f62b..06c22d15b3 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -16,7 +16,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index c87e65c80b..1363c703f9 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -17,7 +17,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index e8817bd150..c5deaa61a2 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -17,7 +17,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR="$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]' + SWIFT_EXTRACTOR_DIR=`"$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]'` $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 From ae01aeb740971cb7e7f9d5b5af1c6d3ca6abbbfb Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 17:44:15 -0800 Subject: [PATCH 08/22] Set Swift env variable globally --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 4 ++-- pr-checks/checks/export-file-baseline-information.yml | 3 ++- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 4 ++-- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 2c01104e6f..acd78a643a 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -49,7 +49,6 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Get Swift version id: get_swift_version # We don't support Swift on Windows @@ -98,4 +97,5 @@ jobs: fi done env: + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA. CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index b7dadba9df..3cca60e413 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -71,5 +71,5 @@ jobs: exit 1 fi env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA. CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 041e0d1bb7..4759c52557 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,7 +59,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=`"$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]'` + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 @@ -79,6 +79,6 @@ jobs: exit 1 fi env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA. DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' CODEQL_ACTION_TEST_MODE: true diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 69319169d1..9c21480976 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -1,6 +1,8 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] +env: + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA. steps: - uses: ./../action/init id: init @@ -9,7 +11,6 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Get Swift version id: get_swift_version # We don't support Swift on Windows diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 1363c703f9..db51f24e20 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -4,7 +4,7 @@ versions: ["latest", "cached", "nightly-latest"] # Swift autobuilder is only supported on MacOS for private beta operatingSystems: ["macos"] env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - uses: ./../action/init id: init diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index c5deaa61a2..5712c20226 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -3,7 +3,7 @@ description: "Tests creation of a Swift database using custom build" versions: ["latest", "cached", "nightly-latest"] operatingSystems: ["ubuntu", "macos"] env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - uses: ./../action/init @@ -17,7 +17,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=`"$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]'` + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 From bf101aff0be51692b33ba5dc3ff7c5c84bb6eaf6 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Thu, 15 Dec 2022 17:47:56 -0800 Subject: [PATCH 09/22] Test resolve languages command --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__multi-language-autodetect.yml | 2 +- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 2 +- pr-checks/checks/export-file-baseline-information.yml | 2 +- pr-checks/checks/multi-language-autodetect.yml | 2 +- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index acd78a643a..8cb9644d1d 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -57,7 +57,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index e6e99d1a5e..fe55fe59fc 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -77,7 +77,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 3cca60e413..6e98902b3b 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -53,7 +53,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 4759c52557..c2b6a4bc95 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,7 +59,7 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 9c21480976..4f814e0796 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -19,7 +19,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 06c22d15b3..e4286917d4 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -16,7 +16,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index db51f24e20..29f411a81d 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -17,7 +17,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 5712c20226..6a4f3503c0 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -17,7 +17,7 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 From 8abe7d85e1daa2b443943acc01af51aca7c44849 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 08:47:10 -0800 Subject: [PATCH 10/22] Simply print the Swift extractor dir --- .github/workflows/__export-file-baseline-information.yml | 5 +++-- .github/workflows/__multi-language-autodetect.yml | 7 ++++--- .github/workflows/__swift-autobuild.yml | 5 +++-- .github/workflows/__swift-custom-build.yml | 5 +++-- pr-checks/checks/export-file-baseline-information.yml | 5 +++-- pr-checks/checks/multi-language-autodetect.yml | 7 ++++--- pr-checks/checks/swift-autobuild.yml | 5 +++-- pr-checks/checks/swift-custom-build.yml | 5 +++-- 8 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 8cb9644d1d..b3cd342993 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -57,8 +57,9 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index fe55fe59fc..a0aef0007f 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -77,10 +77,11 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: swift-version: ${{steps.get_swift_version.outputs.version}} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 6e98902b3b..9085fd136d 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -53,8 +53,9 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index c2b6a4bc95..47c4449348 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,8 +59,9 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 4f814e0796..b90f7163e4 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -19,8 +19,9 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index e4286917d4..6fd792b3e7 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -16,10 +16,11 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: swift-version: "${{steps.get_swift_version.outputs.version}}" diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 29f411a81d..1d41d0b56b 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -17,8 +17,9 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 6a4f3503c0..ee9b1696be 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -17,8 +17,9 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json) - $SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }' + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') + echo "$SWIFT_EXTRACTOR_DIR" + VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: From f57b19c508a181e2b2e215611f76a2128eb81199 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 14:00:18 -0800 Subject: [PATCH 11/22] Only check Swift version for latest CLIs --- .github/workflows/__multi-language-autodetect.yml | 8 ++++++-- pr-checks/checks/multi-language-autodetect.yml | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index a0aef0007f..df4613d7ec 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -73,6 +73,8 @@ jobs: - name: Get Swift version id: get_swift_version + if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version + == 'nightly-latest') shell: bash env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} @@ -83,6 +85,8 @@ jobs: echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version + == 'nightly-latest') with: swift-version: ${{steps.get_swift_version.outputs.version}} @@ -139,8 +143,8 @@ jobs: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\ - \ == 'latest' || matrix.version == 'nightly-latest')" + if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version + == 'nightly-latest') shell: bash run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 6fd792b3e7..e07b0e5a59 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -12,6 +12,7 @@ steps: - name: Get Swift version id: get_swift_version + if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" shell: bash env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} @@ -22,6 +23,7 @@ steps: echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" with: swift-version: "${{steps.get_swift_version.outputs.version}}" @@ -77,7 +79,7 @@ steps: fi - name: Check language autodetect for Swift - if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" shell: bash run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} From b72cfb67a32dd296084459924466c994a796cab7 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 14:01:27 -0800 Subject: [PATCH 12/22] Update with correct extractor path --- .github/workflows/__export-file-baseline-information.yml | 5 ++--- .github/workflows/__multi-language-autodetect.yml | 5 ++--- .github/workflows/__swift-autobuild.yml | 5 ++--- .github/workflows/__swift-custom-build.yml | 5 ++--- pr-checks/checks/export-file-baseline-information.yml | 5 ++--- pr-checks/checks/multi-language-autodetect.yml | 5 ++--- pr-checks/checks/swift-autobuild.yml | 5 ++--- pr-checks/checks/swift-custom-build.yml | 5 ++--- 8 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index b3cd342993..9b3e170c27 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -57,9 +57,8 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index df4613d7ec..dc78635f9c 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -79,9 +79,8 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 9085fd136d..9c7335f03d 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -53,9 +53,8 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 47c4449348..9f1424e7fc 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,9 +59,8 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index b90f7163e4..502ce11114 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -19,9 +19,8 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index e07b0e5a59..bdca346124 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -17,9 +17,8 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 1d41d0b56b..938ce2a0e7 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -17,9 +17,8 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index ee9b1696be..b42308eb43 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -17,9 +17,8 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq '.swift[0]') - echo "$SWIFT_EXTRACTOR_DIR" - VERSION=$($SWIFT_EXTRACTOR_DIR --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: From 4efa3408f90e53ce3e0e30fbd1409b7ebf9cf485 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 14:25:44 -0800 Subject: [PATCH 13/22] Use correct platform for extractor --- .github/workflows/__export-file-baseline-information.yml | 7 ++++++- .github/workflows/__multi-language-autodetect.yml | 7 ++++++- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 7 ++++++- pr-checks/checks/export-file-baseline-information.yml | 7 ++++++- pr-checks/checks/multi-language-autodetect.yml | 7 ++++++- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 7 ++++++- 8 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 9b3e170c27..c6db50fe12 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -57,8 +57,13 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this step on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index dc78635f9c..4c7980679e 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -79,8 +79,13 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this test on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 9c7335f03d..e1f232136f 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -54,7 +54,7 @@ jobs: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 9f1424e7fc..f328274316 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -59,8 +59,13 @@ jobs: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this test on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 502ce11114..402397d9f9 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -19,8 +19,13 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this step on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index bdca346124..e1ed931e3e 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -17,8 +17,13 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this test on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 938ce2a0e7..c0a823ebfa 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -18,7 +18,7 @@ steps: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index b42308eb43..0b4f63857b 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -17,8 +17,13 @@ steps: env: CODEQL_PATH: ${{steps.init.outputs.codeql-path}} run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this test on Windows. + PLATFORM="linux64" + fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/*/extractor --version | awk '/version/ { print $3 }') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: From c50429df72cb185bd22f0f76c1aa05f908f338a0 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 14:40:45 -0800 Subject: [PATCH 14/22] Specify v5.7.0 rather than 5.7 --- .github/workflows/__export-file-baseline-information.yml | 3 +++ .github/workflows/__multi-language-autodetect.yml | 3 +++ .github/workflows/__swift-autobuild.yml | 3 +++ .github/workflows/__swift-custom-build.yml | 4 ++++ pr-checks/checks/export-file-baseline-information.yml | 3 +++ pr-checks/checks/multi-language-autodetect.yml | 3 +++ pr-checks/checks/swift-autobuild.yml | 3 +++ pr-checks/checks/swift-custom-build.yml | 4 ++++ 8 files changed, 26 insertions(+) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index c6db50fe12..a82b02c447 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -64,6 +64,9 @@ jobs: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 4c7980679e..afccdb804b 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -86,6 +86,9 @@ jobs: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index e1f232136f..dfd986a958 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -55,6 +55,9 @@ jobs: run: | SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index f328274316..7011dbf2b0 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -66,6 +66,10 @@ jobs: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + # Specify 5.7.0, otherwise setup Action will default to latest minor version. + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 402397d9f9..7d751d9a3f 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -26,6 +26,9 @@ steps: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: runner.os != 'Windows' diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index e1ed931e3e..ee96334e94 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -24,6 +24,9 @@ steps: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index c0a823ebfa..14f010ee11 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -19,6 +19,9 @@ steps: run: | SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 0b4f63857b..b6c93007e6 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -24,6 +24,10 @@ steps: fi SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + # Specify 5.7.0, otherwise setup Action will default to latest minor version. + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 with: From e6054670b425a65381fcfe7157ec844059c1d90a Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 15:40:10 -0800 Subject: [PATCH 15/22] Address review comments --- .github/setup-swift/action.yml | 32 +++++++++++++++++++ .../__export-file-baseline-information.yml | 25 ++------------- .../workflows/__multi-language-autodetect.yml | 28 +++------------- .github/workflows/__swift-autobuild.yml | 17 ++-------- .github/workflows/__swift-custom-build.yml | 23 ++----------- .../export-file-baseline-information.yml | 25 ++------------- .../checks/multi-language-autodetect.yml | 26 +++------------ pr-checks/checks/swift-autobuild.yml | 17 ++-------- pr-checks/checks/swift-custom-build.yml | 23 ++----------- 9 files changed, 58 insertions(+), 158 deletions(-) create mode 100644 .github/setup-swift/action.yml diff --git a/.github/setup-swift/action.yml b/.github/setup-swift/action.yml new file mode 100644 index 0000000000..819ebc8a47 --- /dev/null +++ b/.github/setup-swift/action.yml @@ -0,0 +1,32 @@ +name: "Setup Swift" +description: Performs necessary steps to set up appropriate Swift version. +inputs: + codeql-path: + required: true +runs: + using: "composite" + steps: + - name: Get Swift version + id: get_swift_version + # We don't support Swift on Windows or prior versions of CLI. + if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + env: + CODEQL_PATH: ${{inputs.codeql-path}} + run: | + if [ $RUNNER_OS = "macOS" ]; then + PLATFORM="osx64" + else # We do not run this step on Windows. + PLATFORM="linux64" + fi + SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') + VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + # Specify 5.7.0, otherwise setup Action will default to latest minor version. + if [ $VERSION = "5.7" ]; then + VERSION="5.7.0" + fi + echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + with: + swift-version: "${{steps.get_swift_version.outputs.version}}" diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index a82b02c447..c21549986f 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,6 +42,7 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: @@ -49,29 +50,9 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - name: Get Swift version - id: get_swift_version - # We don't support Swift on Windows - if: runner.os != 'Windows' - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this step on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - if: runner.os != 'Windows' + - uses: ./.github/setup-swift with: - swift-version: ${{steps.get_swift_version.outputs.version}} + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index afccdb804b..a1506470da 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,37 +65,17 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 + - uses: actions/checkout@v3 + - uses: ./../action/init id: init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version - == 'nightly-latest') - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this test on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version - == 'nightly-latest') + - uses: ./.github/setup-swift with: - swift-version: ${{steps.get_swift_version.outputs.version}} + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index dfd986a958..f733d05674 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,26 +42,15 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + - uses: ./.github/setup-swift with: - swift-version: ${{steps.get_swift_version.outputs.version}} + codeql-path: ${{steps.init.outputs.codeql-path}} - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 7011dbf2b0..88d1ec6697 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,32 +48,15 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this test on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - # Specify 5.7.0, otherwise setup Action will default to latest minor version. - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + - uses: ./.github/setup-swift with: - swift-version: ${{steps.get_swift_version.outputs.version}} + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 7d751d9a3f..9da00fcc54 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -4,6 +4,7 @@ versions: ["nightly-latest"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA. steps: + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: @@ -11,29 +12,9 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - name: Get Swift version - id: get_swift_version - # We don't support Swift on Windows - if: runner.os != 'Windows' - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this step on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - if: runner.os != 'Windows' + - uses: ./.github/setup-swift with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index ee96334e94..a3437cdf5b 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,35 +4,17 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: + - uses: actions/checkout@v3 + - uses: ./../action/init id: init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this test on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 - if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + - uses: ./.github/setup-swift with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 14f010ee11..3d0bcbef5c 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,26 +6,15 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/osx64/extractor --version | awk '/version/ { print $3 }') # Update platform if more operating systems are added to this test. - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + - uses: ./.github/setup-swift with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + codeql-path: ${{steps.init.outputs.codeql-path}} - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index b6c93007e6..9307032570 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,32 +6,15 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - name: Get Swift version - id: get_swift_version - shell: bash - env: - CODEQL_PATH: ${{steps.init.outputs.codeql-path}} - run: | - if [ $RUNNER_OS = "macOS" ]; then - PLATFORM="osx64" - else # We do not run this test on Windows. - PLATFORM="linux64" - fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') - # Specify 5.7.0, otherwise setup Action will default to latest minor version. - if [ $VERSION = "5.7" ]; then - VERSION="5.7.0" - fi - echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 + - uses: ./.github/setup-swift with: - swift-version: "${{steps.get_swift_version.outputs.version}}" + codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code shell: bash run: ./build.sh From 8b813b92a6d0fcaf47f153cf77c9793a5e862f03 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 16:04:57 -0800 Subject: [PATCH 16/22] Add prepare-test step to composite action --- .github/setup-swift/action.yml | 4 ++++ .github/workflows/__export-file-baseline-information.yml | 3 ++- .github/workflows/__multi-language-autodetect.yml | 5 +++-- .github/workflows/__swift-autobuild.yml | 3 ++- .github/workflows/__swift-custom-build.yml | 3 ++- pr-checks/checks/export-file-baseline-information.yml | 3 ++- pr-checks/checks/multi-language-autodetect.yml | 5 +++-- pr-checks/checks/swift-autobuild.yml | 3 ++- pr-checks/checks/swift-custom-build.yml | 3 ++- 9 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/setup-swift/action.yml b/.github/setup-swift/action.yml index 819ebc8a47..8d7ca50620 100644 --- a/.github/setup-swift/action.yml +++ b/.github/setup-swift/action.yml @@ -30,3 +30,7 @@ runs: if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" with: swift-version: "${{steps.get_swift_version.outputs.version}}" + # We run prepare-test again to return to the appropriate directory before building. + - uses: ./.github/prepare-test + with: + version: ${{ matrix.version }} diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index c21549986f..33699adf55 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,7 +42,6 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: @@ -50,6 +49,8 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index a1506470da..e1a4c1c86d 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,14 +65,15 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 - - uses: actions/checkout@v3 - - uses: ./../action/init id: init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 + - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index f733d05674..c1e05a99f7 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,12 +42,13 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 88d1ec6697..6f5a3a417e 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,12 +48,13 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 9da00fcc54..38055eb584 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -4,7 +4,6 @@ versions: ["nightly-latest"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true # Remove when Swift is GA. steps: - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: @@ -12,6 +11,8 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index a3437cdf5b..844b9c4b74 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,13 +4,14 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - - uses: actions/checkout@v3 - - uses: ./../action/init id: init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} + + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 3d0bcbef5c..945b8c53d0 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,12 +6,13 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 9307032570..3142767d37 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,12 +6,13 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - - uses: actions/checkout@v3 - uses: ./../action/init id: init with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} + # We check out the repo again in order to access the setup-swift composite action. + - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} From 3dcfa890782ff5568e6470a4f5d267f830769b2f Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 16:10:56 -0800 Subject: [PATCH 17/22] Change dir instead of re-running prepare test --- .github/setup-swift/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/setup-swift/action.yml b/.github/setup-swift/action.yml index 8d7ca50620..1bede3b47a 100644 --- a/.github/setup-swift/action.yml +++ b/.github/setup-swift/action.yml @@ -26,11 +26,9 @@ runs: VERSION="5.7.0" fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT + # We return to the appropriate directory for the rest of the workflow. + cd ../action - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" with: swift-version: "${{steps.get_swift_version.outputs.version}}" - # We run prepare-test again to return to the appropriate directory before building. - - uses: ./.github/prepare-test - with: - version: ${{ matrix.version }} From eeabe6a4c50ef74e990d02ea7e9d1c5b032c8521 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 16:16:48 -0800 Subject: [PATCH 18/22] Print directory after Swift setup Action --- .github/setup-swift/action.yml | 4 +--- .github/workflows/__export-file-baseline-information.yml | 4 +++- .github/workflows/__multi-language-autodetect.yml | 4 ++++ .github/workflows/__swift-autobuild.yml | 3 +++ .github/workflows/__swift-custom-build.yml | 3 +++ pr-checks/checks/export-file-baseline-information.yml | 4 +++- pr-checks/checks/multi-language-autodetect.yml | 4 ++++ pr-checks/checks/swift-autobuild.yml | 3 +++ pr-checks/checks/swift-custom-build.yml | 3 +++ 9 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/setup-swift/action.yml b/.github/setup-swift/action.yml index 1bede3b47a..46a6badebe 100644 --- a/.github/setup-swift/action.yml +++ b/.github/setup-swift/action.yml @@ -1,4 +1,4 @@ -name: "Setup Swift" +name: "Set up Swift" description: Performs necessary steps to set up appropriate Swift version. inputs: codeql-path: @@ -26,8 +26,6 @@ runs: VERSION="5.7.0" fi echo "version=$VERSION" | tee -a $GITHUB_OUTPUT - # We return to the appropriate directory for the rest of the workflow. - cd ../action - uses: swift-actions/setup-swift@194625b58a582570f61cc707c3b558086c26b723 if: "(runner.os != 'Windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" with: diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 33699adf55..5809810008 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -54,6 +54,9 @@ jobs: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - name: Build code shell: bash run: ./build.sh @@ -62,7 +65,6 @@ jobs: output: ${{ runner.temp }}/results env: CODEQL_FILE_BASELINE_INFORMATION: true - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Upload SARIF uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index e1a4c1c86d..65f1a92b55 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -78,6 +78,10 @@ jobs: with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd + - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index c1e05a99f7..0c8fb1bf15 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -52,6 +52,9 @@ jobs: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 6f5a3a417e..517980370e 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -58,6 +58,9 @@ jobs: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 38055eb584..69ad491e09 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -16,6 +16,9 @@ steps: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - name: Build code shell: bash run: ./build.sh @@ -24,7 +27,6 @@ steps: output: "${{ runner.temp }}/results" env: CODEQL_FILE_BASELINE_INFORMATION: true - CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: true - name: Upload SARIF uses: actions/upload-artifact@v3 with: diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 844b9c4b74..1272f9fbf7 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -17,6 +17,10 @@ steps: with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd + - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 945b8c53d0..f304d7b45f 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -16,6 +16,9 @@ steps: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - uses: ./../action/autobuild - uses: ./../action/analyze id: analysis diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 3142767d37..fa4b9ac344 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -16,6 +16,9 @@ steps: - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} + - name: Check working directory + shell: bash + run: pwd - name: Build code shell: bash run: ./build.sh From b44d043f4fc4caa154663d323d2d0bff4b41a357 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Fri, 16 Dec 2022 16:36:51 -0800 Subject: [PATCH 19/22] Stop checking out repo again --- .github/workflows/__export-file-baseline-information.yml | 5 ----- .github/workflows/__multi-language-autodetect.yml | 7 ------- .github/workflows/__swift-autobuild.yml | 2 -- .github/workflows/__swift-custom-build.yml | 2 -- pr-checks/checks/export-file-baseline-information.yml | 5 ----- pr-checks/checks/multi-language-autodetect.yml | 7 ------- pr-checks/checks/swift-autobuild.yml | 2 -- pr-checks/checks/swift-custom-build.yml | 2 -- 8 files changed, 32 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 5809810008..ed310d82ae 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -49,14 +49,9 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - - name: Check working directory - shell: bash - run: pwd - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 65f1a92b55..3c62a70c16 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -71,17 +71,10 @@ jobs: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - - name: Check working directory - shell: bash - run: pwd - - name: Build code shell: bash run: ./build.sh diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 0c8fb1bf15..029e02b65b 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -47,8 +47,6 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 517980370e..b6365980a3 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -53,8 +53,6 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 69ad491e09..41408b437b 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -11,14 +11,9 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - - name: Check working directory - shell: bash - run: pwd - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 1272f9fbf7..4561d82481 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -10,17 +10,10 @@ steps: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - - name: Check working directory - shell: bash - run: pwd - - name: Build code shell: bash run: ./build.sh diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index f304d7b45f..18873b2af7 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -11,8 +11,6 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index fa4b9ac344..312f8e6c1f 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -11,8 +11,6 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - # We check out the repo again in order to access the setup-swift composite action. - - uses: actions/checkout@v3 - uses: ./.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} From bfbd05fcba355a111ca39b695a2550deb59a3c30 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Mon, 19 Dec 2022 09:50:19 -0800 Subject: [PATCH 20/22] Use proper file path for setup swift --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__multi-language-autodetect.yml | 2 +- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 2 +- pr-checks/checks/export-file-baseline-information.yml | 2 +- pr-checks/checks/multi-language-autodetect.yml | 2 +- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index ed310d82ae..eb75dad618 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -49,7 +49,7 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 3c62a70c16..7c49fffc10 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -71,7 +71,7 @@ jobs: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 029e02b65b..2a14d5852e 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -47,7 +47,7 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index b6365980a3..81c7a8ecb1 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -53,7 +53,7 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 41408b437b..edf6961c4d 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -11,7 +11,7 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 4561d82481..43b835b3da 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -10,7 +10,7 @@ steps: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index 18873b2af7..eb25a9c523 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -11,7 +11,7 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 312f8e6c1f..e507a1c61a 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -11,7 +11,7 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./.github/setup-swift + - uses: ../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory From 609cafead7b0fd6429d2ed3c880d08c160cd9932 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Mon, 19 Dec 2022 10:30:12 -0800 Subject: [PATCH 21/22] Update .github/setup-swift/action.yml Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com> --- .github/setup-swift/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/setup-swift/action.yml b/.github/setup-swift/action.yml index 46a6badebe..eb4f72f68d 100644 --- a/.github/setup-swift/action.yml +++ b/.github/setup-swift/action.yml @@ -19,8 +19,8 @@ runs: else # We do not run this step on Windows. PLATFORM="linux64" fi - SWIFT_EXTRACTOR_DIR=$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]') - VERSION=$($SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor --version | awk '/version/ { print $3 }') + SWIFT_EXTRACTOR_DIR="$("$CODEQL_PATH" resolve languages --format json | jq -r '.swift[0]')" + VERSION="$("$SWIFT_EXTRACTOR_DIR/tools/$PLATFORM/extractor" --version | awk '/version/ { print $3 }')" # Specify 5.7.0, otherwise setup Action will default to latest minor version. if [ $VERSION = "5.7" ]; then VERSION="5.7.0" From e49ccec9a6d23f8968635d96624bfa5730a00a5d Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Mon, 19 Dec 2022 12:02:15 -0800 Subject: [PATCH 22/22] Update file path for setup-swift --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__multi-language-autodetect.yml | 2 +- .github/workflows/__swift-autobuild.yml | 2 +- .github/workflows/__swift-custom-build.yml | 2 +- pr-checks/checks/export-file-baseline-information.yml | 2 +- pr-checks/checks/multi-language-autodetect.yml | 2 +- pr-checks/checks/swift-autobuild.yml | 2 +- pr-checks/checks/swift-custom-build.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index eb75dad618..e8bb8ad7c0 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -49,7 +49,7 @@ jobs: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 7c49fffc10..9a7adcb7d9 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -71,7 +71,7 @@ jobs: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 2a14d5852e..678a1498a4 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -47,7 +47,7 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 81c7a8ecb1..d5ebde1be1 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -53,7 +53,7 @@ jobs: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index edf6961c4d..e3008a1567 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -11,7 +11,7 @@ steps: tools: ${{ steps.prepare-test.outputs.tools-url }} env: CODEQL_FILE_BASELINE_INFORMATION: true - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Build code diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 43b835b3da..9b9b5336c5 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -10,7 +10,7 @@ steps: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index eb25a9c523..2d57e634f7 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -11,7 +11,7 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index e507a1c61a..b704e33584 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -11,7 +11,7 @@ steps: with: languages: swift tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ../action/.github/setup-swift + - uses: ./../action/.github/setup-swift with: codeql-path: ${{steps.init.outputs.codeql-path}} - name: Check working directory