diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index 7a3ddab379..956a6280c2 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 3895159c65..0000000000 --- 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 2dcb112de0..99f1f6f33b 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 daad374af3..0000000000 --- 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