|
60 | 60 | target/release/ruby-extractor |
61 | 61 | target/release/ruby-extractor.exe |
62 | 62 | retention-days: 1 |
| 63 | + compile-queries: |
| 64 | + runs-on: ubuntu-latest |
| 65 | + env: |
| 66 | + CODEQL_THREADS: 4 # TODO: remove this once it's set by the CLI |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@v2 |
| 69 | + - name: Fetch CodeQL |
| 70 | + run: | |
| 71 | + LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -1) |
| 72 | + gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST" |
| 73 | + unzip -q codeql-linux64.zip |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ github.token }} |
| 76 | + - name: Build Query Pack |
| 77 | + run: | |
| 78 | + codeql/codeql pack create ql/src --output target/packs |
| 79 | + codeql/codeql pack create upgrades --output target/packs |
| 80 | + cp -r ql/src/codeql-suites target/packs/github_codeql-ruby_*/ |
| 81 | + - name: Compile with previous CodeQL versions |
| 82 | + run: | |
| 83 | + for version in $(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | tail -3 | head -2); do |
| 84 | + rm -f codeql-linux64.zip |
| 85 | + gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$version" |
| 86 | + rm -rf codeql; unzip -q codeql-linux64.zip |
| 87 | + codeql/codeql query compile target/packs/* |
| 88 | + done |
| 89 | + env: |
| 90 | + GITHUB_TOKEN: ${{ github.token }} |
| 91 | + - uses: actions/upload-artifact@v2 |
| 92 | + with: |
| 93 | + name: codeql-ruby-queries |
| 94 | + path: | |
| 95 | + target/packs/* |
| 96 | + retention-days: 1 |
| 97 | + |
63 | 98 | package: |
64 | 99 | runs-on: ubuntu-latest |
65 | 100 | needs: build |
@@ -95,3 +130,20 @@ jobs: |
95 | 130 | name: codeql-ruby-pack |
96 | 131 | path: codeql-ruby.zip |
97 | 132 | retention-days: 1 |
| 133 | + - uses: actions/download-artifact@v2 |
| 134 | + with: |
| 135 | + name: codeql-ruby-queries |
| 136 | + path: qlpacks |
| 137 | + - run: | |
| 138 | + echo '{ |
| 139 | + "provide": [ |
| 140 | + "ruby/codeql-extractor.yml", |
| 141 | + "qlpacks/*/qlpack.yml" |
| 142 | + ] |
| 143 | + }' > .codeqlmanifest.json |
| 144 | + zip -rq codeql-ruby-bundle.zip .codeqlmanifest.json ruby qlpacks |
| 145 | + - uses: actions/upload-artifact@v2 |
| 146 | + with: |
| 147 | + name: codeql-ruby-bundle |
| 148 | + path: codeql-ruby-bundle.zip |
| 149 | + retention-days: 1 |
0 commit comments