|
51 | 51 | run: | |
52 | 52 | brew install gnu-tar |
53 | 53 | echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH |
54 | | - - name: Install cargo-cross |
55 | | - if: runner.os == 'Linux' |
56 | | - run: cargo install cross --version 0.2.5 |
| 54 | + - name: Prepare Windows |
| 55 | + if: runner.os == 'Windows' |
| 56 | + shell: powershell |
| 57 | + run: | |
| 58 | + git config --global core.longpaths true |
57 | 59 | - uses: ./.github/actions/os-version |
58 | 60 | id: os_version |
59 | 61 | - name: Cache entire extractor |
|
82 | 84 | - name: Run tests |
83 | 85 | if: steps.cache-extractor.outputs.cache-hit != 'true' |
84 | 86 | run: cd extractor && cargo test --verbose |
85 | | - # On linux, build the extractor via cross in a centos7 container. |
86 | | - # This ensures we don't depend on glibc > 2.17. |
87 | | - - name: Release build (linux) |
88 | | - if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os == 'Linux' |
89 | | - run: | |
90 | | - cd extractor |
91 | | - cross build --release |
92 | | - mv target/x86_64-unknown-linux-gnu/release/codeql-extractor-ruby target/release/ |
93 | | - - name: Release build (windows and macos) |
94 | | - if: steps.cache-extractor.outputs.cache-hit != 'true' && runner.os != 'Linux' |
| 87 | + - name: Release build |
| 88 | + if: steps.cache-extractor.outputs.cache-hit != 'true' |
95 | 89 | run: cd extractor && cargo build --release |
96 | 90 | - name: Generate dbscheme |
97 | 91 | if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}} |
@@ -123,7 +117,7 @@ jobs: |
123 | 117 | - name: Cache compilation cache |
124 | 118 | id: query-cache |
125 | 119 | uses: ./.github/actions/cache-query-compilation |
126 | | - with: |
| 120 | + with: |
127 | 121 | key: ruby-build |
128 | 122 | - name: Build Query Pack |
129 | 123 | run: | |
@@ -235,54 +229,3 @@ jobs: |
235 | 229 | shell: bash |
236 | 230 | run: | |
237 | 231 | codeql database analyze --search-path "${{ runner.temp }}/ruby-bundle" --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls |
238 | | -
|
239 | | - # This is a copy of the 'test' job that runs in a centos7 container. |
240 | | - # This tests that the extractor works correctly on systems with an old glibc. |
241 | | - test-centos7: |
242 | | - defaults: |
243 | | - run: |
244 | | - working-directory: ${{ github.workspace }} |
245 | | - strategy: |
246 | | - fail-fast: false |
247 | | - runs-on: ubuntu-latest |
248 | | - container: |
249 | | - image: centos:centos7 |
250 | | - env: |
251 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
252 | | - needs: [package] |
253 | | - steps: |
254 | | - - name: Install gh cli |
255 | | - run: | |
256 | | - yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo |
257 | | - # fetch-codeql requires unzip and jq |
258 | | - # jq is available in epel-release (https://docs.fedoraproject.org/en-US/epel/) |
259 | | - yum install -y gh unzip epel-release |
260 | | - yum install -y jq |
261 | | - - uses: actions/checkout@v3 |
262 | | - - name: Fetch CodeQL |
263 | | - uses: ./.github/actions/fetch-codeql |
264 | | - |
265 | | - # Due to a bug in Actions, we can't use runner.temp in the run blocks here. |
266 | | - # https://github.com/actions/runner/issues/2185 |
267 | | - |
268 | | - - name: Download Ruby bundle |
269 | | - uses: actions/download-artifact@v3 |
270 | | - with: |
271 | | - name: codeql-ruby-bundle |
272 | | - path: ${{ runner.temp }} |
273 | | - - name: Unzip Ruby bundle |
274 | | - shell: bash |
275 | | - run: unzip -q -d "$RUNNER_TEMP"/ruby-bundle "$RUNNER_TEMP"/codeql-ruby-bundle.zip |
276 | | - |
277 | | - - name: Run QL test |
278 | | - shell: bash |
279 | | - run: | |
280 | | - codeql test run --search-path "$RUNNER_TEMP"/ruby-bundle --additional-packs "$RUNNER_TEMP"/ruby-bundle ruby/ql/test/library-tests/ast/constants/ |
281 | | - - name: Create database |
282 | | - shell: bash |
283 | | - run: | |
284 | | - codeql database create --search-path "$RUNNER_TEMP"/ruby-bundle --language ruby --source-root ruby/ql/test/library-tests/ast/constants/ ../database |
285 | | - - name: Analyze database |
286 | | - shell: bash |
287 | | - run: | |
288 | | - codeql database analyze --search-path "$RUNNER_TEMP"/ruby-bundle --format=sarifv2.1.0 --output=out.sarif ../database ruby-code-scanning.qls |
0 commit comments