Skip to content

Commit c466a26

Browse files
committed
Add ci.yml
1 parent 130172e commit c466a26

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [14.x, 16.x, 18.x, 20.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
working-directory: MinimaJS
28+
run: npm ci
29+
30+
- name: Run tests
31+
working-directory: MinimaJS
32+
run: npm test
33+
34+
- name: Check bundle size
35+
working-directory: MinimaJS
36+
run: npm run size
37+
38+
- name: Build minified versions
39+
working-directory: MinimaJS
40+
run: npm run build

.github/workflows/publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@ jobs:
2525
scope: '@tolinsimpson'
2626

2727
- name: Install dependencies
28+
working-directory: MinimaJS
2829
run: npm ci
2930

3031
- name: Verify package
32+
working-directory: MinimaJS
3133
run: npm pack --dry-run
3234

3335
- name: Build package
36+
working-directory: MinimaJS
3437
run: npm run build
3538

3639
- name: Publish to GitHub Packages
40+
working-directory: MinimaJS
3741
run: npm publish
3842
env:
3943
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)