Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clean up npm scripts and pr validation workflow #1601

Merged
merged 5 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .github/workflows/cypress.yml

This file was deleted.

61 changes: 55 additions & 6 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,69 @@
name: AUTO Pull Request validation
on: [pull_request]
jobs:
pr_validation:
lint:
name: Lint commit msg + code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
name: Install Node 22
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Bootstrap project
run: npm run bootstrap
- name: Run test for the patchset
run: USE_REACT_STRICT_MODE=1 npm run test:patchset # TODO run individual checks and tests instead so when one fails the cause is easier to track down
- name: Lint commit
run: npm run lint:commit
- name: Lint code
run: npm run lint:changes
vitest-tests:
name: Vitest unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Bootstrap project
run: npm run bootstrap
- name: Run vitest unit tests
run: npm run test:vitest
cypress:
name: Cypress component tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Bootstrap project
run: npm run bootstrap
- name: Run Cypress components tests
run: npm run cy:component
legacy-tests:
name: Legacy unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Bootstrap project
run: npm run bootstrap
- name: Run legacy unit tests
run: npm run test
- name: Run legacy jest tests
run: npm run test:jest
4 changes: 3 additions & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci && npm run bootstrap
- name: Npm install and bootstrap
run: npm ci && npm run bootstrap
if: github.event.action != 'closed' # don't run install and bootstrap unnecessarily when pr is closed
- name: Build docs-app
run: npm run build:docs
if: github.event.action != 'closed'
Expand Down
189 changes: 0 additions & 189 deletions package-lock.json

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

11 changes: 1 addition & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
"start": "npm run start --workspace=docs-app",
"start:watch": "npm run start:watch --workspace=docs-app",
"dev": "npm run start:watch",
"test:patchset": "npm-run-all lint:commit lint:changes test:vitest test test:jest",
"pretest:merge": "npm run bootstrap && npm run check",
"test:merge": "npm-run-all lint:commit lint test",
"test:all": "npm-run-all test:jest test",
"test:watch": "ui-scripts test --watch --no-headless",
"test:changes": "ui-scripts test --changed --randomize",
"test": "ui-scripts test --randomize",
"test:jest": "lerna run test:jest --stream",
"cy:component": "cypress run --component",
Expand All @@ -36,8 +30,6 @@
"lint:staged": "lint-staged",
"update:package:list": "lerna run generate:package:list --stream --scope @instructure/instui-config",
"commit:package:list": "git add packages/instui-config/package-lists/**/package-list.json",
"generate:component": "npm run instui create component --workspace=@instructure/instui-cli",
"generate:package": "npm run instui create package --workspace=@instructure/instui-cli",
"bootstrap": "node scripts/bootstrap.js",
"build": "lerna run build --stream",
"build:watch": "lerna run build:watch --stream",
Expand All @@ -52,7 +44,7 @@
"dev:examples": "lerna run start:watch --stream --scope docs-examples",
"prestart:examples": "npm run bootstrap",
"start:examples": "lerna run start --stream --scope docs-examples",
"husky:pre-commit": "npm-run-all update:package:list commit:package:list lint:staged ts:check:references",
"husky:pre-commit": "npm run update:package:list && npm run commit:package:list && npm run lint:staged && npm run ts:check:references",
matyasf marked this conversation as resolved.
Show resolved Hide resolved
"husky:pre-push": "npm run lint:commit",
"build-storybook": "lerna run bundle --stream --scope docs-examples",
"postinstall": "husky",
Expand Down Expand Up @@ -90,7 +82,6 @@
"husky": "^9.0.11",
"lerna": "^7.4.2",
"lint-staged": "^15.2.7",
"npm-run-all": "^4.1.5",
"react": "^18.3.1",
"typescript": "5.5.3",
"vitest": "^2.0.2",
Expand Down
Loading