From 78d9191526a82d2b4e5ae1fbe542f2649d381329 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Mon, 24 May 2021 12:50:14 +0200 Subject: [PATCH] Build query pack --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11e96b146a1..cbbae3cbf58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,6 +60,31 @@ jobs: target/release/ruby-extractor target/release/ruby-extractor.exe retention-days: 1 + compile-queries: + runs-on: ubuntu-latest + env: + CODEQL_THREADS: 4 # TODO: remove this once it's set by the CLI + steps: + - uses: actions/checkout@v2 + - name: Fetch CodeQL + run: | + LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -1) + gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST" + unzip -q codeql-linux64.zip + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Build Query Pack + run: | + codeql/codeql pack create ql/src --output target/packs + codeql/codeql pack create upgrades --output target/packs + cp -r ql/src/codeql-suites target/packs/github_codeql-ruby_*/ + - uses: actions/upload-artifact@v2 + with: + name: codeql-ruby-queries + path: | + target/packs/* + retention-days: 1 + package: runs-on: ubuntu-latest needs: build @@ -95,3 +120,20 @@ jobs: name: codeql-ruby-pack path: codeql-ruby.zip retention-days: 1 + - uses: actions/download-artifact@v2 + with: + name: codeql-ruby-queries + path: qlpacks + - run: | + echo '{ + "provide": [ + "ruby/codeql-extractor.yml", + "qlpacks/*/qlpack.yml" + ] + }' > .codeqlmanifest.json + zip -rq codeql-ruby-bundle.zip .codeqlmanifest.json ruby qlpacks + - uses: actions/upload-artifact@v2 + with: + name: codeql-ruby-bundle + path: codeql-ruby-bundle.zip + retention-days: 1