Merge pull request #161 from alibaba/chore/action-test

refactor: run test cases depend on which files have been changed
This commit is contained in:
林熠 2022-03-22 09:48:28 +08:00 committed by GitHub
commit 60edcb922f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 56 additions and 2 deletions

44
.github/workflows/test modules.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: lint & test
on:
push:
paths:
- 'modules/**'
- '!modules/**.md'
pull_request:
paths:
- 'modules/**'
- '!modules/**.md'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i
- name: lint
run: npm run lint:modules
test-code-generator:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: install
run: npm i && npm run setup:skip-build
- name: test
run: cd modules/code-generator && npm i && npm run build && npm test

View File

@ -1,6 +1,14 @@
name: lint & test
on: [push, pull_request]
on:
push:
paths:
- 'packages/**'
- '!packages/**.md'
pull_request:
paths:
- 'packages/**'
- '!packages/**.md'
jobs:
lint:

View File

@ -1,2 +1,2 @@
export * from './run';
export * from './init-solution';
export * from './init-solution';

View File

@ -16,6 +16,8 @@
"clean": "rm -rf ./packages/*/lib ./packages/*/es ./packages/*/dist ./packages/*/build",
"lint": "f2elint scan -q -i ./packages/*/src",
"lint:fix": "f2elint fix -i ./packages/*/src",
"lint:modules": "f2elint scan -q -i ./modules/*/src",
"lint:modules:fix": "f2elint fix -i ./modules/*/src",
"pub": "npm run watchdog:build && lerna publish patch --force-publish --exact --no-changelog",
"pub:premajor": "npm run watchdog:build && lerna publish premajor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",