Skip to content

Commit 1266f12

Browse files
AugustinMauroymarijnh
authored andcommitted
setup(ci): consolidate
1 parent 0d046aa commit 1266f12

3 files changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,38 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
13
name: ci
2-
on: [push, pull_request]
4+
5+
on:
6+
pull_request:
7+
branches: [ main ]
8+
push:
9+
branches: [ main ]
10+
311
permissions:
412
contents: read
13+
514
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
name: Check code style
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version-file: '.nvmrc'
23+
cache: 'npm'
24+
- run: npm ci
25+
- run: node --run lint
26+
627
build-and-test:
728
runs-on: ubuntu-latest
829
name: Build and test
930
steps:
1031
- uses: actions/checkout@v4
1132
- uses: actions/setup-node@v4
12-
- run: npm install
13-
- run: npm test
14-
- run: npm run test:test262
33+
with:
34+
node-version-file: '.nvmrc'
35+
cache: 'npm'
36+
- run: npm ci
37+
- run: node --run test
38+
- run: node --run test:test262

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
"generate:identifier-regex": "node bin/generate-identifier-regex.js",
3030
"generate:unicode-script-values": "node bin/generate-unicode-script-values.js",
3131
"lint": "eslint .",
32+
"lint:fix": "eslint . --fix",
3233
"prepare": "npm run test",
3334
"pretest": "npm run build:main && npm run build:loose",
34-
"test": "node test/run.js && npm run lint",
35+
"test": "node test/run.js",
3536
"test:test262": "node bin/run_test262.js"
3637
},
3738
"devDependencies": {

0 commit comments

Comments
 (0)