Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright 2015 Shuai Zhang
# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception

name: JavaScript CodeQL Configuration

paths-ignore:
- node_modules
- dist
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2015 Shuai Zhang
# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
actions-minor:
update-types:
- minor
- patch

- package-ecosystem: npm
directory: /
schedule:
interval: weekly
groups:
npm-development:
dependency-type: development
update-types:
- minor
- patch
npm-production:
dependency-type: production
update-types:
- patch
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Copyright 2015 Shuai Zhang
# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception

name: Continuous Integration

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions:
contents: read

jobs:
validation:
name: Validate
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Mise Install Tools
uses: jdx/mise-action@v3
with:
experimental: true
install_args: "hk pkl typos go:github.com/B1NARY-GR0UP/nwa"

- name: Set up PNPM
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22.x
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate with HK
if: github.event_name == 'push'
run: |
BASE="${{ github.event.before }}"
HEAD="${{ github.sha }}"

echo "hk check from $BASE to $HEAD"
hk check --check --from-ref "$BASE" --to-ref "$HEAD"

- name: Validate with HK
if: github.event_name == 'pull_request'
run: |
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.event.pull_request.head.sha }}"

echo "hk check from $BASE to $HEAD"
hk check --check --from-ref "$BASE" --to-ref "$HEAD"

- name: Validate with PNPM
run: pnpm lint && pnpm typecheck

test:
name: Test & Build
runs-on: ubuntu-latest

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

- name: Set up PNPM
uses: pnpm/action-setup@v4

- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20.19.0
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Run tests
run: pnpm run test

- name: Build
run: pnpm run build
52 changes: 52 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2015 Shuai Zhang
# SPDX-License-Identifier: LGPL-3.0-or-later WITH LGPL-3.0-linking-exception

name: CodeQL

on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: '31 7 * * 3'

permissions:
actions: read
checks: write
contents: read
security-events: write

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

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

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v5

- name: Initialize CodeQL
id: initialize
uses: github/codeql-action/init@v4
with:
config-file: .github/codeql/codeql-config.yml
languages: ${{ matrix.language }}
source-root: src

- name: Autobuild
id: autobuild
uses: github/codeql-action/autobuild@v4

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@v4