Skip to content

Commit

Permalink
build: config codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
longlho committed Aug 22, 2020
1 parent 18407c1 commit 716a5bd
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 51 deletions.
8 changes: 8 additions & 0 deletions .github/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'CodeQL config'

paths-ignore:
- node_modules
- '**/*.test.*'
- test262
paths:
- packages
104 changes: 53 additions & 51 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [main, ]
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
Expand All @@ -15,55 +15,57 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Bazel Cache
uses: actions/cache@v2.1.1
with:
path: |
~/.cache/bazel
~/.cache/bazel-disk-cache
key: ${{ runner.os }}-bazel-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bazel-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2.1.1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 100
- name: Bazel Cache
uses: actions/cache@v2.1.1
with:
path: |
~/.cache/bazel
~/.cache/bazel-disk-cache
key: ${{ runner.os }}-bazel-${{ github.sha }}
restore-keys: |
${{ runner.os }}-bazel-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2.1.1
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 100

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
with:
languages: javascript
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Use Node.js 12
uses: actions/setup-node@v2.1.1
with:
node-version: 12

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Use Node.js 12
uses: actions/setup-node@v2.1.1
with:
node-version: 12

- name: Build
run: |
yarn install --frozen-lockfile
yarn build
env:
CI: true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Build
run: |
yarn install --frozen-lockfile
yarn build
env:
CI: true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
config-file: ./.github/codeql-config.yml

0 comments on commit 716a5bd

Please sign in to comment.