Skip to content

Commit 744d0a1

Browse files
authored
ci: configure base pipeline (#1)
* ci: configure base pipeline * ci: use `action/checkout` v5 * ci: disable codeql action
1 parent 1963cdb commit 744d0a1

11 files changed

Lines changed: 495 additions & 143 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# This is a Github Workflow that runs tests on any push or pull request.
2+
# If the tests pass and this is a push to the master branch it also runs Semantic Release.
3+
name: CI
4+
on: [push, pull_request]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v5
10+
- name: Use Node.js 24
11+
uses: actions/setup-node@v5
12+
with:
13+
node-version: 24
14+
cache: 'npm'
15+
- run: npm ci
16+
- run: npm run build
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: build
20+
path: |
21+
target
22+
package.json
23+
jsr.json
24+
retention-days: 1
25+
26+
push:
27+
name: Push ${{ github.ref }}
28+
needs: build
29+
if: github.event_name == 'push'
30+
runs-on: ubuntu-latest
31+
permissions:
32+
checks: read
33+
statuses: write
34+
contents: write
35+
packages: write
36+
id-token: write
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v5
40+
with:
41+
fetch-depth: ${{ github.ref == 'refs/heads/main' && '0' || '1' }}
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v5
44+
with:
45+
node-version: 24
46+
cache: 'npm'
47+
- uses: actions/download-artifact@v4
48+
with:
49+
name: build
50+
- name: Fetch deps
51+
run: npm ci
52+
- name: Run tests
53+
run: npm run test
54+
55+
# - name: Semantic Release (npm)
56+
# if: github.ref == 'refs/heads/main'
57+
# env:
58+
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
59+
# NPM_PROVENANCE: true
60+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
# GIT_BRANCH: 'main'
62+
# GIT_AUTHOR_NAME: ${{ vars.GIT_AUTHOR_NAME }}
63+
# GIT_AUTHOR_EMAIL: ${{ vars.GIT_AUTHOR_EMAIL }}
64+
# GIT_COMMITTER_NAME: ${{ vars.GIT_COMMITTER_NAME }}
65+
# GIT_COMMITTER_EMAIL: ${{ vars.GIT_COMMITTER_EMAIL }}
66+
# run: npx zx-semrel
67+
68+
pr:
69+
if: github.event_name == 'pull_request'
70+
needs: build
71+
name: PR (Node v${{ matrix.node-version }}, OS ${{ matrix.os }})
72+
strategy:
73+
matrix:
74+
os: [ ubuntu-latest, windows-latest ]
75+
node-version: [ 18, 24 ]
76+
77+
runs-on: ${{ matrix.os }}
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v5
81+
- name: Setup Node.js
82+
uses: actions/setup-node@v5
83+
with:
84+
node-version: ${{ matrix.node-version }}
85+
cache: 'npm'
86+
- uses: actions/download-artifact@v4
87+
with:
88+
name: build
89+
90+
- name: Run all tests
91+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 24
92+
run: |
93+
npm ci
94+
npm run test
95+
# - name: Run spawn tests (win32)
96+
# if: matrix.os == 'windows-latest' && matrix.node-version == 24
97+
# run: |
98+
# npm ci
99+
# node --loader ts-node/esm --experimental-specifier-resolution=node ./src/test/ts/spawn.test.ts
100+
# timeout-minutes: 5
101+
#
102+
# - name: Run smoke:esm tests
103+
# if: matrix.node-version >= 12
104+
# run: npm run test:smoke:esm
105+
#
106+
# - name: Run smoke:cjs tests
107+
# run: npm run test:smoke:cjs
108+
109+
# smoke-bun:
110+
# runs-on: ubuntu-latest
111+
# name: Smoke Bun
112+
# needs: build
113+
# steps:
114+
# - uses: actions/checkout@v5
115+
# - name: Setup Bun
116+
# uses: antongolub/action-setup-bun@v1
117+
# - uses: actions/download-artifact@v4
118+
# with:
119+
# name: build
120+
# - run: |
121+
# bun ./src/test/smoke/invoke.test.cjs
122+
# bun ./src/test/smoke/invoke.test.mjs
123+
#
124+
# smoke-deno:
125+
# runs-on: ubuntu-latest
126+
# name: Smoke Deno ${{ matrix.deno-version }}
127+
# needs: build
128+
# strategy:
129+
# matrix:
130+
# deno-version: [ v1.x, v2.x ]
131+
# steps:
132+
# - uses: actions/checkout@v5
133+
# - name: Setup Deno
134+
# uses: denoland/setup-deno@v2
135+
# with:
136+
# deno-version: ${{ matrix.deno-version }}
137+
# - run: deno install npm:types/node
138+
# - uses: actions/download-artifact@v4
139+
# with:
140+
# name: build
141+
# - run: deno test --allow-read --allow-sys --allow-env --allow-run ./src/test/smoke/invoke.test.mjs

.github/workflows/codeql.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL Advanced"
13+
14+
on:
15+
push:
16+
branches: ["turn-on-later"]
17+
# push:
18+
# branches: [ "main" ]
19+
# pull_request:
20+
# branches: [ "main" ]
21+
# schedule:
22+
# - cron: '17 20 * * 0'
23+
24+
jobs:
25+
analyze:
26+
name: Analyze (${{ matrix.language }})
27+
# Runner size impacts CodeQL analysis time. To learn more, please see:
28+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
29+
# - https://gh.io/supported-runners-and-hardware-resources
30+
# - https://gh.io/using-larger-runners (GitHub.com only)
31+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
32+
runs-on: 'ubuntu-latest'
33+
permissions:
34+
# required for all workflows
35+
security-events: write
36+
37+
# required to fetch internal or private CodeQL packs
38+
packages: read
39+
40+
# only required for workflows in private repositories
41+
actions: read
42+
contents: read
43+
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- language: javascript-typescript
49+
build-mode: none
50+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
51+
# Use `c-cpp` to analyze code written in C, C++ or both
52+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57+
# 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
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
62+
# Initializes the CodeQL tools for scanning.
63+
- name: Initialize CodeQL
64+
uses: github/codeql-action/init@v3
65+
with:
66+
languages: ${{ matrix.language }}
67+
build-mode: ${{ matrix.build-mode }}
68+
# If you wish to specify custom queries, you can do so here or in a config file.
69+
# By default, queries listed here will override any specified in a config file.
70+
# Prefix the list here with "+" to use these queries and those in the config file.
71+
72+
# 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
73+
# queries: security-extended,security-and-quality
74+
75+
# If the analyze step fails for one of the languages you are analyzing with
76+
# "We were unable to automatically build your code", modify the matrix above
77+
# to set the build mode to "manual" for that language. Then modify this step
78+
# to build your code.
79+
# ℹ️ Command-line programs to run using the OS shell.
80+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
81+
- if: matrix.build-mode == 'manual'
82+
shell: bash
83+
run: |
84+
echo 'If you are using a "manual" build mode for one or more of the' \
85+
'languages you are analyzing, replace this with the commands to build' \
86+
'your code, for example:'
87+
echo ' make bootstrap'
88+
echo ' make release'
89+
exit 1
90+
91+
- name: Perform CodeQL Analysis
92+
uses: github/codeql-action/analyze@v3
93+
with:
94+
category: "/language:${{matrix.language}}"

.gitignore

Lines changed: 17 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,18 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
1+
# Deps
412
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Optional stylelint cache
57-
.stylelintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
63-
*.tgz
64-
65-
# Yarn Integrity file
66-
.yarn-integrity
67-
68-
# dotenv environment variable files
69-
.env
70-
.env.*
71-
!.env.example
72-
73-
# parcel-bundler cache (https://parceljs.org/)
74-
.cache
75-
.parcel-cache
76-
77-
# Next.js build output
78-
.next
79-
out
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and not Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# vuepress v2.x temp and cache directory
95-
.temp
96-
.cache
97-
98-
# Sveltekit cache directory
99-
.svelte-kit/
100-
101-
# vitepress build output
102-
**/.vitepress/dist
103-
104-
# vitepress cache directory
105-
**/.vitepress/cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# Firebase cache directory
120-
.firebase/
121-
122-
# TernJS port file
123-
.tern-port
124-
125-
# Stores VSCode versions used for testing VSCode extensions
126-
.vscode-test
127-
128-
# yarn v3
129-
.pnp.*
130-
.yarn/*
131-
!.yarn/patches
132-
!.yarn/plugins
133-
!.yarn/releases
134-
!.yarn/sdks
135-
!.yarn/versions
136-
137-
# Vite logs files
138-
vite.config.js.timestamp-*
139-
vite.config.ts.timestamp-*
3+
yarn.lock
4+
pnpm-lock.yaml
5+
6+
# Bundles
7+
target/*
8+
!target/cjs/
9+
!target/esm/
10+
!target/dts/
11+
jsr.json
12+
buildstamp.json
13+
14+
# Temp
15+
temp
16+
17+
#
18+
.npmrc

0 commit comments

Comments
 (0)