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
141 changes: 141 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# This is a Github Workflow that runs tests on any push or pull request.
# If the tests pass and this is a push to the master branch it also runs Semantic Release.
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Use Node.js 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: |
target
package.json
jsr.json
retention-days: 1

push:
name: Push ${{ github.ref }}
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
checks: read
statuses: write
contents: write
packages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: ${{ github.ref == 'refs/heads/main' && '0' || '1' }}
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 24
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: build
- name: Fetch deps
run: npm ci
- name: Run tests
run: npm run test

# - name: Semantic Release (npm)
# if: github.ref == 'refs/heads/main'
# env:
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# NPM_PROVENANCE: true
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GIT_BRANCH: 'main'
# GIT_AUTHOR_NAME: ${{ vars.GIT_AUTHOR_NAME }}
# GIT_AUTHOR_EMAIL: ${{ vars.GIT_AUTHOR_EMAIL }}
# GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME }}
# GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL }}
# run: npx zx-semrel

pr:
if: github.event_name == 'pull_request'
needs: build
name: PR (Node v${{ matrix.node-version }}, OS ${{ matrix.os }})
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
node-version: [ 18, 24 ]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- uses: actions/download-artifact@v4
with:
name: build

- name: Run all tests
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
run: |
npm ci
npm run test
# - name: Run spawn tests (win32)
# if: matrix.os == 'windows-latest' && matrix.node-version == 24
# run: |
# npm ci
# node --loader ts-node/esm --experimental-specifier-resolution=node ./src/test/ts/spawn.test.ts
# timeout-minutes: 5
#
# - name: Run smoke:esm tests
# if: matrix.node-version >= 12
# run: npm run test:smoke:esm
#
# - name: Run smoke:cjs tests
# run: npm run test:smoke:cjs

# smoke-bun:
# runs-on: ubuntu-latest
# name: Smoke Bun
# needs: build
# steps:
# - uses: actions/checkout@v5
# - name: Setup Bun
# uses: antongolub/action-setup-bun@v1
# - uses: actions/download-artifact@v4
# with:
# name: build
# - run: |
# bun ./src/test/smoke/invoke.test.cjs
# bun ./src/test/smoke/invoke.test.mjs
#
# smoke-deno:
# runs-on: ubuntu-latest
# name: Smoke Deno ${{ matrix.deno-version }}
# needs: build
# strategy:
# matrix:
# deno-version: [ v1.x, v2.x ]
# steps:
# - uses: actions/checkout@v5
# - name: Setup Deno
# uses: denoland/setup-deno@v2
# with:
# deno-version: ${{ matrix.deno-version }}
# - run: deno install npm:types/node
# - uses: actions/download-artifact@v4
# with:
# name: build
# - run: deno test --allow-read --allow-sys --allow-env --allow-run ./src/test/smoke/invoke.test.mjs
94 changes: 94 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: ["turn-on-later"]
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
# schedule:
# - cron: '17 20 * * 0'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# 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 (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: 'ubuntu-latest'
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
155 changes: 17 additions & 138 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,139 +1,18 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
# Deps
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.*
!.env.example

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Sveltekit cache directory
.svelte-kit/

# vitepress build output
**/.vitepress/dist

# vitepress cache directory
**/.vitepress/cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Firebase cache directory
.firebase/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Vite logs files
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
yarn.lock
pnpm-lock.yaml

# Bundles
target/*
!target/cjs/
!target/esm/
!target/dts/
jsr.json
buildstamp.json

# Temp
temp

#
.npmrc
Loading
Loading