Skip to content

Commit cc59ca0

Browse files
authored
Merge pull request #36 from jridgewell/actions
Run tests on commit or PRs
2 parents 4bbeb75 + 2ab18b6 commit cc59ca0

File tree

4 files changed

+5055
-2
lines changed

4 files changed

+5055
-2
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
jobs:
10+
build:
11+
name: Build and Test
12+
timeout-minutes: 15
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Setup Node.js environment
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Build
31+
run: npm run build
32+
33+
- name: Test
34+
run: npm run test

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ node_modules
33
dist
44
types
55
coverage
6-
package-lock.json
76
.idea
87
.turbo
98
*.tsbuildinfo

esbuild.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync, writeFileSync } from 'node:fs';
1+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
22
import { dirname } from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import * as esbuild from 'esbuild';
@@ -115,6 +115,7 @@ async function build(esm) {
115115
process.exit(1);
116116
}
117117

118+
mkdirSync('dist', { recursive: true });
118119
for (const file of build.outputFiles) {
119120
if (!file.path.endsWith('.umd.js')) {
120121
writeFileSync(file.path, file.contents);

0 commit comments

Comments
 (0)