Repository navigation
DO NOT MERGE: Remove caching steps from QL4QL workflows #222
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Collect database stats for QL for QL | |
| on: | |
| push: | |
| branches: ['henrymercer/test-ql4ql-*'] | |
| env: | |
| CODEQL_ACTION_PER_LANGUAGE_BUNDLES: "true" | |
| permissions: | |
| contents: read | |
| security-events: read | |
| jobs: | |
| measure: | |
| strategy: | |
| matrix: | |
| repo: | |
| - github/codeql | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Find codeql | |
| id: find-codeql | |
| uses: github/codeql-action/setup-codeql@main | |
| - name: Build Extractor | |
| run: cd ql; env "PATH=$PATH:`dirname ${CODEQL}`" ./scripts/create-extractor-pack.sh | |
| env: | |
| CODEQL: ${{ steps.find-codeql.outputs.codeql-path }} | |
| - name: Checkout ${{ matrix.repo }} | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: ${{ matrix.repo }} | |
| path: ${{ github.workspace }}/repo | |
| - name: Create database | |
| run: | | |
| "${CODEQL}" database create \ | |
| --search-path "${{ github.workspace }}" \ | |
| --threads 4 \ | |
| --language ql --source-root "${{ github.workspace }}/repo" \ | |
| "${{ runner.temp }}/database" | |
| env: | |
| CODEQL: ${{ steps.find-codeql.outputs.codeql-path }} | |
| - name: Measure database | |
| run: | | |
| mkdir -p "stats/${{ matrix.repo }}" | |
| "${CODEQL}" dataset measure --threads 4 --output "stats/${{ matrix.repo }}/stats.xml" "${{ runner.temp }}/database/db-ql" | |
| env: | |
| CODEQL: ${{ steps.find-codeql.outputs.codeql-path }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: measurements | |
| path: stats | |
| retention-days: 1 | |
| merge: | |
| runs-on: ubuntu-latest | |
| needs: measure | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: measurements | |
| path: stats | |
| - run: | | |
| python -m pip install --user lxml | |
| find stats -name 'stats.xml' -print0 | sort -z | xargs -0 python ruby/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ql.dbscheme.stats | |
| path: ql/ql/src/ql.dbscheme.stats |