Merge branch 'master' of https://github.com/didi/mpx #17761
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: test | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| tsc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| packages/*/node_modules | |
| key: checks-${{ runner.os }}-${{ runner.arch }}-node-modules-v1-${{ hashFiles('**/package.json', '.npmrc') }} | |
| restore-keys: | | |
| checks-${{ runner.os }}-${{ runner.arch }}-node-modules-v1- | |
| - run: npm i | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| - run: npm run build:tsc | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| packages/*/node_modules | |
| key: checks-${{ runner.os }}-${{ runner.arch }}-node-modules-v1-${{ hashFiles('**/package.json', '.npmrc') }} | |
| restore-keys: | | |
| checks-${{ runner.os }}-${{ runner.arch }}-node-modules-v1- | |
| - run: npm i | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| - run: npm run lint | |
| unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.npm | |
| node_modules | |
| test/e2e/miniprogram-project/node_modules | |
| test/e2e/plugin-project/node_modules | |
| packages/webpack-plugin/node_modules | |
| packages/core/node_modules | |
| packages/api-proxy/node_modules | |
| packages/perf/node_modules | |
| packages/unocss-base/node_modules | |
| packages/unocss-plugin/node_modules | |
| key: unit-${{ runner.os }}-${{ runner.arch }}-node-modules-v1-${{ hashFiles('**/package.json', '.npmrc') }} | |
| restore-keys: | | |
| unit-${{ runner.os }}-${{ runner.arch }}-node-modules-v1- | |
| - name: install deps | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: npm i && npm i --prefix test/e2e/miniprogram-project && npm i --prefix test/e2e/plugin-project | |
| - name: copy-webpack-plugin | |
| run: npm run copyPlugin --prefix test/e2e/miniprogram-project && npm run copyPlugin --prefix test/e2e/plugin-project | |
| - name: build-miniprogram | |
| run: npm run build:cross --prefix test/e2e/miniprogram-project | |
| - name: build-plugin | |
| run: npm run build --prefix test/e2e/plugin-project | |
| - name: build-tsc | |
| run: npm run build:tsc | |
| - name: exec unit test | |
| run: npm t && npm t --prefix test/e2e/miniprogram-project && npm t --prefix test/e2e/plugin-project |