Skip to content

Commit

Permalink
chore: use jobs for artifact generation (#8864)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrandolf committed Aug 31, 2022
1 parent 2922166 commit eb6cea4
Show file tree
Hide file tree
Showing 13 changed files with 438 additions and 113 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -68,10 +68,15 @@ jobs:
run: npm run docs
- name: Check if autogenerated docs differ
run: |
if [[ $(git diff) ]]; then
echo "Please update the documentation by running 'npm run docs'"
diff_file=$(mktemp doc_diff_XXXXXX)
git diff --color > $diff_file
if [[ -s $diff_file ]]; then
echo "Please update the documentation by running 'npm run docs'. The following was the diff"
cat $diff_file
rm $diff_file
exit 1
fi
rm $diff_file
- name: Check if docs need to be deployed
id: needs_deploying
run: |
Expand Down Expand Up @@ -165,7 +170,7 @@ jobs:
if: ${{ matrix.spec.name == 'Linux' }}
run: sudo apt-get install xvfb
- name: Build
run: npm run build
run: npm run build:ci
- name: Test types
run: npm run test:types
# On Linux we run all Chrome tests without retries and Firefox tests with retries.
Expand Down Expand Up @@ -215,7 +220,7 @@ jobs:
ls .local-chromium
- name: Build
run: |
npm run build
npm run build:ci
docker/pack.sh
- name: Build docker image
working-directory: ./docker
Expand Down
216 changes: 203 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 11 additions & 9 deletions package.json
Expand Up @@ -42,24 +42,24 @@
"lint:eslint": "([ \"$CI\" = true ] && eslint --ext js --ext ts --quiet -f codeframe . || eslint --ext js --ext ts .)",
"install": "node install.js",
"generate:sources": "tsx utils/generate_sources.ts",
"generate:types": "node utils/export_all.js && api-extractor run --local --verbose && eslint --ext ts --no-ignore --no-eslintrc -c .eslintrc.types.cjs --fix lib/types.d.ts",
"generate:markdown": "tsx utils/generate_docs.ts && prettier --ignore-path none --write docs",
"generate:esm-package-json": "echo '{\"type\": \"module\"}' > lib/esm/package.json",
"generate:artifacts": "tsx utils/generate_artifacts.ts",
"generate:markdown": "tsx utils/generate_docs.ts",
"format": "run-s format:*",
"format:prettier": "prettier --write .",
"format:eslint": "eslint --ext js --ext ts --fix .",
"docs": "run-s build generate:markdown",
"debug": "npm run build && mocha --inspect-brk",
"debug": "npm run build:test && mocha --inspect-brk",
"commitlint": "commitlint --from=HEAD~1",
"clean": "rimraf lib && rimraf test/build",
"check": "run-p check:*",
"check:protocol-revision": "tsx scripts/ensure-correct-devtools-protocol-package",
"check:pinned-deps": "tsx scripts/ensure-pinned-deps",
"build": "run-s generate:sources build:tsc generate:types generate:esm-package-json",
"build:tsc": "tsc --version && run-p build:tsc:*",
"build:tsc:esm": "tsc -b src/tsconfig.esm.json",
"build:tsc:cjs": "tsc -b src/tsconfig.cjs.json",
"build:tsc:test": "tsc -b test"
"build": "npm run build:lib",
"build:test": "run-s generate:sources build:tsc:test",
"build:ci": "run-s build:test generate:artifacts",
"build:lib": "run-s generate:sources build:tsc:lib generate:artifacts",
"build:tsc:test": "tsc -b test",
"build:tsc:lib": "tsc -b tsconfig.lib.json"
},
"files": [
"lib",
Expand Down Expand Up @@ -90,6 +90,7 @@
"@microsoft/api-extractor-model": "7.23.0",
"@types/debug": "4.1.7",
"@types/diff": "5.0.2",
"@types/glob": "7.2.0",
"@types/mime": "3.0.1",
"@types/mocha": "9.1.1",
"@types/node": "18.7.1",
Expand Down Expand Up @@ -121,6 +122,7 @@
"eslint-plugin-unused-imports": "2.0.0",
"esprima": "4.0.1",
"expect": "25.2.7",
"glob": "8.0.3",
"gts": "4.0.0",
"husky": "8.0.1",
"jpeg-js": "0.4.4",
Expand Down
3 changes: 2 additions & 1 deletion src/tsconfig.cjs.json
Expand Up @@ -8,5 +8,6 @@
"references": [
{"path": "../vendor/tsconfig.cjs.json"},
{"path": "../compat/cjs/tsconfig.json"}
]
],
"exclude": ["injected/injected.ts"]
}

0 comments on commit eb6cea4

Please sign in to comment.