CodeQL 🔬 #1323
This file contains 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: "CodeQL 🔬" | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: "27 20 * * 5" | |
workflow_dispatch: | |
jobs: | |
analyze: | |
name: Analyze | |
# Runner size impacts CodeQL analysis time. To learn more, please see: | |
# - https://gh.io/recommended-hardware-resources-for-running-codeql | |
# - https://gh.io/supported-runners-and-hardware-resources | |
# - https://gh.io/using-larger-runners | |
# Consider using larger runners for possible analysis time improvements. | |
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | |
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
# # To use Remote Caching, uncomment the next lines and follow the steps below. | |
# env: | |
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
# TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
# TURBO_REMOTE_ONLY: true | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["javascript"] | |
node-version: [v18.x] | |
steps: | |
- name: Checkout repository 🛎️ | |
uses: actions/checkout@v3 | |
- name: Initialize CodeQL ⤵️ | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Cache ♻️ | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules 📃 | |
continue-on-error: true | |
run: npm list | |
- name: Install ⤵️ | |
run: | | |
npm ci | |
- name: Cache Turbo ♻️ | |
uses: dtinth/setup-github-actions-caching-for-turbo@v1 | |
with: | |
cache-prefix: turbo-codeql-${{github.ref}}_ | |
- name: Build 🔧 | |
run: npm run build | |
- name: Perform CodeQL Analysis 🔬 | |
uses: github/codeql-action/analyze@v2 | |
with: | |
category: "/language:${{matrix.language}}" |