From d4020ad3059a1ee4fbe0d26becbab708fee1a9fe Mon Sep 17 00:00:00 2001 From: Harry Maclean Date: Fri, 17 Mar 2023 10:31:58 +1300 Subject: [PATCH] Ruby: Run extractor test on centos 7 --- .github/workflows/ruby-build.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/ruby-build.yml b/.github/workflows/ruby-build.yml index 1e7746c8c403..b06fc70bf9e4 100644 --- a/.github/workflows/ruby-build.yml +++ b/.github/workflows/ruby-build.yml @@ -235,3 +235,42 @@ jobs: shell: bash run: | codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls + + # This is a copy of the 'test' job that runs in a centos7 container. + # This tests that the extractor works correctly on systems with an old glibc. + test-centos7: + defaults: + run: + working-directory: ${{ github.workspace }} + strategy: + fail-fast: false + runs-on: ubuntu-latest + container: + image: centos:centos7 + needs: [package] + steps: + - uses: actions/checkout@v3 + - name: Fetch CodeQL + uses: ./.github/actions/fetch-codeql + + - name: Download Ruby bundle + uses: actions/download-artifact@v3 + with: + name: codeql-ruby-bundle + path: ${{ runner.temp }} + - name: Unzip Ruby bundle + shell: bash + run: unzip -q -d "${{ runner.temp }}/ruby-bundle" "${{ runner.temp }}/codeql-ruby-bundle.zip" + + - name: Run QL test + shell: bash + run: | + codeql test run --search-path "${{ runner.temp }}/ruby-bundle" --additional-packs "${{ runner.temp }}/ruby-bundle" ruby/ql/test/library-tests/ast/constants/ + - name: Create database + shell: bash + run: | + codeql database create --search-path "${{ runner.temp }}/ruby-bundle" --language ruby --source-root ruby/ql/test/library-tests/ast/constants/ ../database + - name: Analyze database + shell: bash + run: | + codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls