diff --git a/.codeqlmanifest.json b/.codeqlmanifest.json new file mode 100644 index 00000000000..ebcd2eec459 --- /dev/null +++ b/.codeqlmanifest.json @@ -0,0 +1,6 @@ +{ "provide": [ "ql/src/qlpack.yml", + "ql/test/qlpack.yml", + "ql/examples/qlpack.yml", + "extractor-pack/codeql-extractor.yml" + ] +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d68301d4278..aa3be0f8756 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-rust-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} - name: Check formatting run: cargo fmt --all -- --check - name: Build diff --git a/.github/workflows/qltest.yml b/.github/workflows/qltest.yml new file mode 100644 index 00000000000..032cad9654b --- /dev/null +++ b/.github/workflows/qltest.yml @@ -0,0 +1,34 @@ +name: Run QL Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +jobs: + qltest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch CodeQL + run: | + gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip + unzip -q codeql-linux64.zip + env: + GITHUB_TOKEN: ${{ github.token }} + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Build Extractor + run: env "PATH=$PATH:${{ github.workspace }}/codeql" ./create-extractor-pack.sh + - name: Run QL tests + run: codeql/codeql test run --search-path "${{ github.workspace }}" ql/test + diff --git a/codeql-extractor.yml b/codeql-extractor.yml index 0e0626e6958..c4000c4c656 100644 --- a/codeql-extractor.yml +++ b/codeql-extractor.yml @@ -2,6 +2,7 @@ name: "ruby" display_name: "Ruby" version: 0.1 column_kind: "utf8" +legacy_qltest_extraction: true file_types: - name: ruby display_name: Ruby files diff --git a/tools/qltest.cmd b/tools/qltest.cmd new file mode 100644 index 00000000000..543c2c36ebd --- /dev/null +++ b/tools/qltest.cmd @@ -0,0 +1,5 @@ +@echo off + +CALL "%CODEQL_EXTRACTOR_RUBY_ROOT%\tools\autobuild.cmd" + +exit /b %ERRORLEVEL% diff --git a/tools/qltest.sh b/tools/qltest.sh new file mode 100755 index 00000000000..b65945f9ee2 --- /dev/null +++ b/tools/qltest.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +exec "${CODEQL_EXTRACTOR_RUBY_ROOT}/tools/autobuild.sh"