Skip to content

Commit 4f7d897

Browse files
committed
Add PR check job for Ruby beta
Add a separate job that analyses the multilanguage test repo's Ruby code. For now, run this only with the latest nightly build of CodeQL, since the latest released build and the cached builds don't support Ruby yet. In future when the latest released build supports Ruby, we can update this and other PR checks to test a wider range of cases.
1 parent d98d4f5 commit 4f7d897

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/pr-checks.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,47 @@ jobs:
497497
exit 1
498498
fi
499499
500+
# Ruby is in beta, so test it separately for now.
501+
multi-language-repo_test-ruby:
502+
needs: [check-js, check-node-modules, check-codeql-versions]
503+
strategy:
504+
fail-fast: false
505+
matrix:
506+
os: [ubuntu-latest, windows-latest, macos-latest]
507+
tools:
508+
# TODO: Add `latest` here when `defaults.json` points to
509+
# a CodeQL release that supports Ruby in beta.
510+
- ${{ needs.check-codeql-versions.outputs.nightly-url }}
511+
runs-on: ${{ matrix.os }}
512+
env:
513+
CODEQL_ENABLE_EXPERIMENTAL_FEATURES: true
514+
515+
steps:
516+
- uses: actions/checkout@v2
517+
- name: Move codeql-action
518+
shell: bash
519+
run: |
520+
mkdir ../action
521+
mv * .github ../action/
522+
mv ../action/tests/multi-language-repo/{*,.github} .
523+
mv ../action/.github/workflows .github
524+
- uses: ./../action/init
525+
with:
526+
languages: ruby
527+
tools: ${{ matrix.tools }}
528+
- uses: ./../action/analyze
529+
id: analysis
530+
env:
531+
TEST_MODE: true
532+
- name: Check database
533+
shell: bash
534+
run: |
535+
RUBY_DB="${{ fromJson(steps.analysis.outputs.db-locations).ruby }}"
536+
if [[ ! -d "$RUBY_DB" ]]; then
537+
echo "Did not create a database for Ruby."
538+
exit 1
539+
fi
540+
500541
multi-language-repo_rubocop:
501542
needs: [check-js, check-node-modules]
502543
runs-on: ubuntu-latest

tests/multi-language-repo/.github/codeql/custom-queries.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: Use custom queries
23

34
disable-default-queries: true

0 commit comments

Comments
 (0)