Skip to content

Commit 54f1b2f

Browse files
committed
Improve workflow
1 parent bea8e1c commit 54f1b2f

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.github/workflows/main.yml

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches: [master]
6-
pull_request:
7-
branches: [master]
3+
on: [push, pull_request]
84

95
jobs:
106
build:
117
runs-on: ubuntu-latest
128

139
strategy:
1410
matrix:
15-
node-version: [10.x, 12.x, 14.x]
11+
node-version: [14.x, 16.x]
1612

1713
steps:
18-
- uses: actions/checkout@v2
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
1916

2017
- name: Use Node.js ${{ matrix.node-version }}
2118
uses: actions/setup-node@v2
2219
with:
2320
node-version: ${{ matrix.node-version }}
2421

25-
- name: npm install, build, and test
22+
- name: Install and Build
2623
run: |
2724
npm install
2825
npm run build
29-
npm test
30-
- uses: codecov/codecov-action@v2
31-
env:
32-
CI: true
26+
27+
- name: Test
28+
run: npm test
29+
30+
- name: Webpack Bundle
31+
run: npm run bundle:tmp
32+
33+
- name: Upload code coverage
34+
uses: codecov/codecov-action@v2

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
"description": "A Schema based Object to Buffer converter",
55
"main": "lib/index.js",
66
"scripts": {
7+
"test:ci": "npm i && npm run build && npm test && npm run bundle:tmp",
78
"start": "npm run dev",
89
"dev": "npm run build && npm-run-all --parallel dev:*",
910
"dev:tsc": "tsc --watch",
1011
"dev:nodemon": "nodemon lib/dev.js --watch lib",
1112
"build": "npm run clean && tsc",
1213
"bundle": "webpack --config webpack.bundle.js",
14+
"bundle:tmp": "webpack --config webpack.bundle.tmp.js",
1315
"test": "jest --collectCoverage",
1416
"clean": "rimraf lib",
1517
"format": "prettier --write src/**/*.ts && prettier --write test/**/*.js",

webpack.bundle.tmp.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const config = require('./webpack.bundle.js')
2+
3+
module.exports = { ...config, output: { ...config.output, filename: 'snapshot-interpolation.tmp.js' } }

0 commit comments

Comments
 (0)