Skip to content

Commit

Permalink
ci: add CodeQL workflow for GitHub code scanning - close #18
Browse files Browse the repository at this point in the history
  • Loading branch information
lgtm-migrator authored and JounQin committed Dec 13, 2023
1 parent e1c0571 commit de4a29c
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"node": "16",
"installCommand": "codesandbox:install",
"node": "18",
"sandboxes": []
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ coverage
dist
lib
CHANGELOG.md
/auto-imports.d.ts
/pnpm-lock.yaml
!/.github
!/.*.cjs
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: pnpm i

- name: Build, Lint and Test
run: pnpm run-s build lint test
run: pnpm run-s build lint
env:
EFF_NO_LINK_RULES: true
PARSER_NO_WATCH: true
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CodeQL

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '18 13 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language:
- javascript

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: '/language:${{ matrix.language }}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage
dist
lib
node_modules
/auto-imports.d.ts
17 changes: 0 additions & 17 deletions auto-imports.d.ts

This file was deleted.

9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,23 @@
"xml-sanitizer"
],
"scripts": {
"build": "run-p build:*",
"build": "pnpm test && run-p build:*",
"build:r": "r -f cjs",
"build:tsc": "tsc -p src",
"codesandbox:install": "yarn",
"dev": "vitest",
"docs:build": "w -e docs -p --publicPath /",
"docs:dev": "w -e docs",
"lint": "run-p lint:*",
"lint:es": "eslint . --cache -f friendly --max-warnings 10",
"lint:style": "stylelint . --cache",
"lint:tsc": "tsc --noEmit",
"postversion": "pnpm i --no-frozen-lockfile",
"prepare": "simple-git-hooks",
"prerelease": "pnpm build",
"release": "changeset publish",
"release": "pnpm build && changeset publish",
"serve": "sirv dist -s",
"test": "vitest run --coverage",
"typecov": "type-coverage",
"vercel-build": "pnpm docs:build",
"version": "changeset version"
"version": "changeset version && pnpm i --no-frozen-lockfile"
},
"devDependencies": {
"@1stg/app-config": "^7.2.1",
Expand Down
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineConfig({
],
test: {
coverage: {
include: ['src'],
provider: 'istanbul',
reporter: ['lcov', 'json', 'text'],
},
Expand Down

0 comments on commit de4a29c

Please sign in to comment.