Skip to content

Commit 7427044

Browse files
test: fix silent failures by moving some scripts to makefile (#3833)
1 parent 8afa199 commit 7427044

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Check Types
2727
run: npm run type-check
2828
- name: Lint
29-
run: npm run lint
29+
run: make lint
3030
- name: Test
3131
run: npm run test
3232
- name: Verify icon changes
@@ -42,7 +42,7 @@ jobs:
4242
- name: Build
4343
run: npm run build
4444
- name: Build Docs
45-
run: npm run build-docs
45+
run: make build-docs
4646
- name: Coverage
4747
uses: codecov/codecov-action@v4
4848
with:

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ test.npm.%: validate-no-uncommitted-package-lock-changes
3232
requirements: ## install ci requirements
3333
npm ci
3434

35+
# npm swallows errors
36+
# see https://github.com/openedx/paragon/issues/3329
37+
#
38+
# Instead of having this directly in the build-docs script
39+
# in the top-level package.json, put it here so we can have
40+
# a single source of truth and get proper error codes in CI
41+
.PHONY: build-docs
42+
build-docs:
43+
npm run build --workspace=www
44+
45+
# npm swallows errors
46+
# see https://github.com/openedx/paragon/issues/3329
47+
#
48+
# Instead of having this directly in the lint script
49+
# in the top-level package.json, put it here so we can have
50+
# a single source of truth and get proper error codes in CI
51+
.PHONY: lint
52+
lint:
53+
npm run stylelint && npm run eslint && npm run lint --workspaces --if-present
54+
3555
i18n.extract:
3656
# Pulling display strings from .jsx files into .json files...
3757
npm run-script i18n_extract

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727
"sideEffects": false,
2828
"scripts": {
2929
"build": "make build",
30-
"build-docs": "npm run build --workspace=www",
30+
"build-docs": "make build-docs",
3131
"commit": "commit",
3232
"debug-test": "node --inspect-brk node_modules/.bin/jest --runInBand --coverage",
3333
"stylelint": "stylelint \"src/**/*.scss\" \"scss/**/*.scss\" \"www/src/**/*.scss\" --config .stylelintrc.json",
34-
"lint": "npm run stylelint && eslint --ext .js --ext .jsx --ext .ts --ext .tsx --ext .json . && npm run lint --workspaces --if-present",
34+
"eslint": "eslint --ext .js --ext .jsx --ext .ts --ext .tsx --ext .json .",
35+
"lint": "make lint",
3536
"lint:fix": "npm run stylelint && eslint --fix --ext .js --ext .jsx --ext .ts --ext .tsx --ext .json . && npm run lint --workspaces --if-present",
3637
"prepublishOnly": "npm run build",
3738
"semantic-release": "semantic-release",

0 commit comments

Comments
 (0)