From 080c56c9eb239fa4edd5a38aa39f368f78ea753f Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 11 Nov 2020 15:52:35 +0100 Subject: [PATCH 1/3] Add QL test support --- .codeqlmanifest.json | 6 ++++++ codeql-extractor.yml | 1 + tools/qltest.cmd | 5 +++++ tools/qltest.sh | 3 +++ 4 files changed, 15 insertions(+) create mode 100644 .codeqlmanifest.json create mode 100644 tools/qltest.cmd create mode 100755 tools/qltest.sh 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/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" From 44150600ab2306625660675d556a3b5c1181b9d8 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 11 Nov 2020 18:23:23 +0100 Subject: [PATCH 2/3] Add QLTest workflow --- .github/workflows/qltest.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/qltest.yml 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 + From 5fe3bf138c99ece8cc677b570aa3805f79ec9923 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Thu, 12 Nov 2020 19:11:04 +0100 Subject: [PATCH 3/3] Change cache key --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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