From bab5a146ac6d7a082c88e24391b2b1fc4ac67ec0 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Tue, 22 Nov 2022 03:03:25 -0800 Subject: [PATCH 1/7] Add Ruby and Swift language autodetect tests (#1369) Co-authored-by: Henry Mercer --- .../workflows/__multi-language-autodetect.yml | 19 +++++- .github/workflows/__ruby-autodetect.yml | 66 ------------------- .../checks/multi-language-autodetect.yml | 19 +++++- pr-checks/checks/ruby-autodetect.yml | 22 ------- 4 files changed, 36 insertions(+), 90 deletions(-) delete mode 100644 .github/workflows/__ruby-autodetect.yml delete mode 100644 pr-checks/checks/ruby-autodetect.yml diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 7a3ddab37..956a6280c 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -74,7 +74,8 @@ jobs: run: ./build.sh - uses: ./../action/analyze id: analysis - - shell: bash + - name: Check language autodetect for all languages excluding Ruby, Swift + shell: bash run: | CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }} if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then @@ -106,5 +107,21 @@ jobs: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi + - name: Check language autodetect for Ruby, Swift + if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version + == 'nightly-latest') + shell: bash + run: |- + RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }} + if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then + echo "Did not create a database for Ruby, or created it in the wrong location." + exit 1 + fi + SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} + if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then + echo "Did not create a database for Swift, or created it in the wrong location." + exit 1 + fi env: + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: 'true' # Remove when Swift is GA. CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__ruby-autodetect.yml b/.github/workflows/__ruby-autodetect.yml deleted file mode 100644 index 3895159c6..000000000 --- a/.github/workflows/__ruby-autodetect.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Warning: This file is generated automatically, and should not be modified. -# Instead, please modify the template in the pr-checks directory and run: -# pip install ruamel.yaml && python3 sync.py -# to regenerate this file. - -name: PR Check - Ruby analysis using autodetect -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GO111MODULE: auto -on: - push: - branches: - - main - - releases/v1 - - releases/v2 - pull_request: - types: - - opened - - synchronize - - reopened - - ready_for_review - workflow_dispatch: {} -jobs: - ruby-autodetect: - strategy: - matrix: - include: - - os: ubuntu-latest - 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 - version: nightly-latest - name: Ruby analysis using autodetect - timeout-minutes: 45 - runs-on: ${{ matrix.os }} - steps: - - name: Check out repository - uses: actions/checkout@v3 - - name: Prepare test - id: prepare-test - uses: ./.github/prepare-test - with: - version: ${{ matrix.version }} - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - id: analysis - - name: Check database - shell: bash - run: | - RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}" - if [[ ! -d "$RUBY_DB" ]]; then - echo "Did not create a database for Ruby." - exit 1 - fi - env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true' - CODEQL_ACTION_TEST_MODE: true diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 2dcb112de..99f1f6f33 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -1,6 +1,8 @@ name: "Multi-language repository" description: "An end-to-end integration test of a multi-language repository using automatic language detection" operatingSystems: ["ubuntu", "macos"] +env: + CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - uses: ./../action/init with: @@ -11,7 +13,8 @@ steps: run: ./build.sh - uses: ./../action/analyze id: analysis - - shell: bash + - name: Check language autodetect for all languages excluding Ruby, Swift + shell: bash run: | CPP_DB=${{ fromJson(steps.analysis.outputs.db-locations).cpp }} if [[ ! -d $CPP_DB ]] || [[ ! $CPP_DB == ${{ runner.temp }}/customDbLocation/* ]]; then @@ -43,3 +46,17 @@ steps: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi + - name: Check language autodetect for Ruby, Swift + if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + run: | + RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }} + if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then + echo "Did not create a database for Ruby, or created it in the wrong location." + exit 1 + fi + SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} + if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then + echo "Did not create a database for Swift, or created it in the wrong location." + exit 1 + fi \ No newline at end of file diff --git a/pr-checks/checks/ruby-autodetect.yml b/pr-checks/checks/ruby-autodetect.yml deleted file mode 100644 index daad374af..000000000 --- a/pr-checks/checks/ruby-autodetect.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This check should be combined into `multi-language-autodetect.yml` once Ruby is GA'ed -# and the `CODEQL_ENABLE_EXPERIMENTAL_FEATURES` environment variable is not needed. -name: "Ruby analysis using autodetect" -description: "Tests creation of a Ruby database when language isn't specified in init" -versions: ["latest", "cached", "nightly-latest"] -operatingSystems: ["ubuntu", "macos"] -env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES: "true" -steps: - - uses: ./../action/init - with: - tools: ${{ steps.prepare-test.outputs.tools-url }} - - uses: ./../action/analyze - id: analysis - - name: Check database - shell: bash - run: | - RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}" - if [[ ! -d "$RUBY_DB" ]]; then - echo "Did not create a database for Ruby." - exit 1 - fi From e9e73b0cb9bf112069c3c777a650862b17380e50 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 11:21:04 +0000 Subject: [PATCH 2/7] Use Swift version 5.7 in PR checks The version installed in the latest runner image, 5.7.1, is not yet supported. --- .../__export-file-baseline-information.yml | 4 ++++ .../workflows/__multi-language-autodetect.yml | 19 +++++++++++++++++-- .github/workflows/__swift-autobuild.yml | 3 +++ .github/workflows/__swift-custom-build.yml | 3 +++ .../export-file-baseline-information.yml | 4 ++++ .../checks/multi-language-autodetect.yml | 18 ++++++++++++++++-- pr-checks/checks/swift-autobuild.yml | 3 +++ pr-checks/checks/swift-custom-build.yml | 3 +++ 8 files changed, 53 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index e5981ea52..11ff8aef0 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,6 +42,10 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 956a6280c..0d6b046a1 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,15 +65,23 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 + - uses: ./../action/init with: db-location: ${{ runner.temp }}/customDbLocation tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code shell: bash run: ./build.sh + - uses: ./../action/analyze id: analysis + - name: Check language autodetect for all languages excluding Ruby, Swift shell: bash run: | @@ -107,16 +115,23 @@ jobs: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi - - name: Check language autodetect for Ruby, Swift + + - name: Check language autodetect for Ruby if: (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest') shell: bash - run: |- + run: | RUBY_DB=${{ fromJson(steps.analysis.outputs.db-locations).ruby }} if [[ ! -d $RUBY_DB ]] || [[ ! $RUBY_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Ruby, or created it in the wrong location." exit 1 fi + + - name: Check language autodetect for Swift + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version\ + \ == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Swift, or created it in the wrong location." diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 8df545be3..eec8380ad 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,6 +42,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 83a0b84ff..4f2b4d91e 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,6 +48,9 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 4ce7d7fbf..2b8c43183 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,6 +2,10 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] steps: + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 - uses: ./../action/init with: languages: javascript diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 99f1f6f33..990d20a5a 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,15 +4,23 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: + - uses: swift-actions/setup-swift@v1 + if: "!startsWith(matrix.os, 'windows')" + with: + swift-version: 5.7 + - uses: ./../action/init with: db-location: "${{ runner.temp }}/customDbLocation" tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Build code shell: bash run: ./build.sh + - uses: ./../action/analyze id: analysis + - name: Check language autodetect for all languages excluding Ruby, Swift shell: bash run: | @@ -46,7 +54,8 @@ steps: echo "Did not create a database for Python, or created it in the wrong location." exit 1 fi - - name: Check language autodetect for Ruby, Swift + + - name: Check language autodetect for Ruby if: "(matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" shell: bash run: | @@ -55,8 +64,13 @@ steps: echo "Did not create a database for Ruby, or created it in the wrong location." exit 1 fi + + - name: Check language autodetect for Swift + if: "!startsWith(matrix.os, 'windows') && (matrix.version == 'cached' || matrix.version == 'latest' || matrix.version == 'nightly-latest')" + shell: bash + run: | SWIFT_DB=${{ fromJson(steps.analysis.outputs.db-locations).swift }} if [[ ! -d $SWIFT_DB ]] || [[ ! $SWIFT_DB == ${{ runner.temp }}/customDbLocation/* ]]; then echo "Did not create a database for Swift, or created it in the wrong location." exit 1 - fi \ No newline at end of file + fi diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index df36ea990..e6ff9f077 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,6 +6,9 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 3b2e3e889..9177c0675 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,6 +6,9 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: + - uses: swift-actions/setup-swift@v1 + with: + swift-version: 5.7 - uses: ./../action/init with: languages: swift From b6e17a66166f5695015ab798507f736d4d6ef21a Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 11:31:22 +0000 Subject: [PATCH 3/7] Drop unneeded `CODEQL_ENABLE_EXPERIMENTAL_FEATURES` env var --- .github/workflows/__ruby.yml | 1 - pr-checks/checks/ruby.yml | 2 -- 2 files changed, 3 deletions(-) diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 7c12669a7..9a3a9f7eb 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -63,5 +63,4 @@ jobs: exit 1 fi env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES: 'true' CODEQL_ACTION_TEST_MODE: true diff --git a/pr-checks/checks/ruby.yml b/pr-checks/checks/ruby.yml index 32b492f55..3b4279aa6 100644 --- a/pr-checks/checks/ruby.yml +++ b/pr-checks/checks/ruby.yml @@ -2,8 +2,6 @@ name: "Ruby analysis" description: "Tests creation of a Ruby database" versions: ["latest", "cached", "nightly-latest"] operatingSystems: ["ubuntu", "macos"] -env: - CODEQL_ENABLE_EXPERIMENTAL_FEATURES: "true" steps: - uses: ./../action/init with: From 5dcca8a6e4106277df2b6296ef89e578fb96b53c Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 20:13:49 +0000 Subject: [PATCH 4/7] Pin the version of `swift-actions/setup-swift@v1` --- .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 11ff8aef0..e99da6330 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -42,7 +42,7 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: swift-version: 5.7 diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 0d6b046a1..5c769eb3a 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -65,7 +65,7 @@ jobs: uses: actions/setup-go@v3 with: go-version: ^1.13.1 - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: swift-version: 5.7 diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index eec8380ad..63e16e3c8 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -42,7 +42,7 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: swift-version: 5.7 - uses: ./../action/init diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 4f2b4d91e..5130a2b71 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -48,7 +48,7 @@ jobs: uses: ./.github/prepare-test with: version: ${{ matrix.version }} - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: swift-version: 5.7 - uses: ./../action/init diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 2b8c43183..d591a15c0 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -2,7 +2,7 @@ name: "Export file baseline information" description: "Tests that file baseline information is exported when the feature is enabled" versions: ["nightly-latest"] steps: - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: swift-version: 5.7 diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 990d20a5a..953d0cd3e 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -4,7 +4,7 @@ operatingSystems: ["ubuntu", "macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: swift-version: 5.7 diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index e6ff9f077..f79ebf58d 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -6,7 +6,7 @@ operatingSystems: ["macos"] env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" steps: - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: swift-version: 5.7 - uses: ./../action/init diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 9177c0675..db9e512a2 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -6,7 +6,7 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: - - uses: swift-actions/setup-swift@v1 + - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: swift-version: 5.7 - uses: ./../action/init From 2ccaddd459eb6bec3d7da17cffdc3fce013d7d3c Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 20:33:22 +0000 Subject: [PATCH 5/7] Define `swift-version` as a string --- .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 e99da6330..5c999cd3c 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -45,7 +45,7 @@ jobs: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: - swift-version: 5.7 + swift-version: '5.7' - uses: ./../action/init with: languages: javascript diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 5c769eb3a..8006aab3d 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -68,7 +68,7 @@ jobs: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: - swift-version: 5.7 + swift-version: '5.7' - uses: ./../action/init with: diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 63e16e3c8..a6e87f05c 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -44,7 +44,7 @@ jobs: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: - swift-version: 5.7 + swift-version: '5.7' - uses: ./../action/init with: languages: swift diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 5130a2b71..fafe05dd6 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -50,7 +50,7 @@ jobs: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: - swift-version: 5.7 + swift-version: '5.7' - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index d591a15c0..476398833 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -5,7 +5,7 @@ steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: - swift-version: 5.7 + swift-version: "5.7" - uses: ./../action/init with: languages: javascript diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 953d0cd3e..6b7ccfe8c 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -7,7 +7,7 @@ steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 if: "!startsWith(matrix.os, 'windows')" with: - swift-version: 5.7 + swift-version: "5.7" - uses: ./../action/init with: diff --git a/pr-checks/checks/swift-autobuild.yml b/pr-checks/checks/swift-autobuild.yml index f79ebf58d..c68bcd4d1 100644 --- a/pr-checks/checks/swift-autobuild.yml +++ b/pr-checks/checks/swift-autobuild.yml @@ -8,7 +8,7 @@ env: steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: - swift-version: 5.7 + swift-version: "5.7" - uses: ./../action/init with: languages: swift diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index db9e512a2..89aaed0c0 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -8,7 +8,7 @@ env: steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 with: - swift-version: 5.7 + swift-version: "5.7" - uses: ./../action/init with: languages: swift From c49c05b5dfc493dbd86d83add17326fe874f2c09 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 20:41:32 +0000 Subject: [PATCH 6/7] Perform the check using `runner.os` --- .github/workflows/__export-file-baseline-information.yml | 2 +- .github/workflows/__multi-language-autodetect.yml | 2 +- pr-checks/checks/export-file-baseline-information.yml | 2 +- pr-checks/checks/multi-language-autodetect.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 5c999cd3c..7a6f19891 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -43,7 +43,7 @@ jobs: with: version: ${{ matrix.version }} - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 - if: "!startsWith(matrix.os, 'windows')" + if: runner.os != 'Windows' with: swift-version: '5.7' - uses: ./../action/init diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 8006aab3d..868fd0116 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -66,7 +66,7 @@ jobs: with: go-version: ^1.13.1 - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 - if: "!startsWith(matrix.os, 'windows')" + if: runner.os != 'Windows' with: swift-version: '5.7' diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 476398833..1aa670d2b 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -3,7 +3,7 @@ description: "Tests that file baseline information is exported when the feature versions: ["nightly-latest"] steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 - if: "!startsWith(matrix.os, 'windows')" + if: runner.os != 'Windows' with: swift-version: "5.7" - uses: ./../action/init diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 6b7ccfe8c..70c2171ff 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -5,7 +5,7 @@ env: CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT: "true" # Remove when Swift is GA. steps: - uses: swift-actions/setup-swift@5cdaa9161ad1f55ae39a5ea1784ef96de72f95d9 - if: "!startsWith(matrix.os, 'windows')" + if: runner.os != 'Windows' with: swift-version: "5.7" From 34d91a9ce7e545287435a65da6abf9e4d125c248 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 22 Nov 2022 20:45:26 +0000 Subject: [PATCH 7/7] Use runner.os in ML-powered queries tests too --- .github/workflows/__ml-powered-queries.yml | 5 ++--- pr-checks/checks/ml-powered-queries.yml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__ml-powered-queries.yml b/.github/workflows/__ml-powered-queries.yml index 6441e8e9d..4b6367ee6 100644 --- a/.github/workflows/__ml-powered-queries.yml +++ b/.github/workflows/__ml-powered-queries.yml @@ -87,8 +87,7 @@ jobs: - name: Check sarif uses: ./../action/.github/check-sarif # Running on Windows requires CodeQL CLI 2.9.0+. - if: "!(matrix.version == 'stable-20220120' && (matrix.os == 'windows-latest'\ - \ || matrix.os == 'windows-2019'))" + if: "!(matrix.version == 'stable-20220120' && runner.os == 'Windows')" with: sarif-file: ${{ runner.temp }}/results/javascript.sarif queries-run: js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss @@ -98,7 +97,7 @@ jobs: env: # Running on Windows requires CodeQL CLI 2.9.0+. SHOULD_RUN_ML_POWERED_QUERIES: ${{ !(matrix.version == 'stable-20220120' && - (matrix.os == 'windows-latest' || matrix.os == 'windows-2019')) }} + runner.os == 'Windows') }} shell: bash run: | echo "Expecting ML-powered queries to be run: ${SHOULD_RUN_ML_POWERED_QUERIES}" diff --git a/pr-checks/checks/ml-powered-queries.yml b/pr-checks/checks/ml-powered-queries.yml index 0e439b408..d0628b32c 100644 --- a/pr-checks/checks/ml-powered-queries.yml +++ b/pr-checks/checks/ml-powered-queries.yml @@ -30,7 +30,7 @@ steps: - name: Check sarif uses: ./../action/.github/check-sarif # Running on Windows requires CodeQL CLI 2.9.0+. - if: "!(matrix.version == 'stable-20220120' && (matrix.os == 'windows-latest' || matrix.os == 'windows-2019'))" + if: "!(matrix.version == 'stable-20220120' && runner.os == 'Windows')" with: sarif-file: ${{ runner.temp }}/results/javascript.sarif queries-run: js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss @@ -39,7 +39,7 @@ steps: - name: Check results env: # Running on Windows requires CodeQL CLI 2.9.0+. - SHOULD_RUN_ML_POWERED_QUERIES: ${{ !(matrix.version == 'stable-20220120' && (matrix.os == 'windows-latest' || matrix.os == 'windows-2019')) }} + SHOULD_RUN_ML_POWERED_QUERIES: ${{ !(matrix.version == 'stable-20220120' && runner.os == 'Windows') }} shell: bash run: | echo "Expecting ML-powered queries to be run: ${SHOULD_RUN_ML_POWERED_QUERIES}"