|
| 1 | +name: Test (Ubuntu) |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow on pull request events for main and release branches |
| 6 | + pull_request: |
| 7 | + branches: [main, release_*, release-*] |
| 8 | + |
| 9 | + push: |
| 10 | + branches: [main, release_*, release-*] |
| 11 | + paths-ignore: |
| 12 | + - 'document/**' |
| 13 | + - '*.md' |
| 14 | + - '*.mdx' |
| 15 | + |
| 16 | + merge_group: |
| 17 | + |
| 18 | + # Allows you to run this workflow manually from the Actions tab |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | + # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 22 | +jobs: |
| 23 | + # ======== ut ======== |
| 24 | + ut-ubuntu: |
| 25 | + runs-on: ubuntu-22.04 |
| 26 | + strategy: |
| 27 | + matrix: |
| 28 | + node-version: [18.x] |
| 29 | + |
| 30 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 |
| 34 | + with: |
| 35 | + fetch-depth: 10 |
| 36 | + |
| 37 | + - name: Install Pnpm |
| 38 | + run: | |
| 39 | + npm install -g corepack@latest --force |
| 40 | + corepack enable |
| 41 | +
|
| 42 | + - name: Check skip CI |
| 43 | + run: echo "RESULT=$(node ./scripts/skipCI.js)" >> "$GITHUB_OUTPUT" |
| 44 | + id: skip-ci |
| 45 | + |
| 46 | + - name: Log skip CI result |
| 47 | + run: echo "${{steps.skip-ci.outputs.RESULT}}" |
| 48 | + |
| 49 | + - name: Setup Node.js ${{ matrix.node-version }} |
| 50 | + if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 51 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 |
| 52 | + with: |
| 53 | + node-version: ${{ matrix.node-version }} |
| 54 | + cache: 'pnpm' |
| 55 | + |
| 56 | + - name: Install Dependencies |
| 57 | + if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 58 | + run: pnpm install && cd ./e2e && npx playwright install chromium |
| 59 | + |
| 60 | + - name: Unit Test |
| 61 | + if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 62 | + run: pnpm run e2e:base e2e/cases/doctor-rspack |
| 63 | + # ======== e2e ======== |
| 64 | + # e2e-ubuntu: |
| 65 | + # runs-on: ubuntu-latest |
| 66 | + # strategy: |
| 67 | + # matrix: |
| 68 | + # node-version: [18.x] |
| 69 | + |
| 70 | + # # Steps represent a sequence of tasks that will be executed as part of the job |
| 71 | + # steps: |
| 72 | + # - name: Checkout |
| 73 | + # uses: actions/checkout@v3 |
| 74 | + # with: |
| 75 | + # fetch-depth: 10 |
| 76 | + |
| 77 | + # - name: Install Pnpm |
| 78 | + # run: corepack enable |
| 79 | + |
| 80 | + # - name: Check skip CI |
| 81 | + # run: echo "RESULT=$(node ./scripts/skipCI.js)" >> "$GITHUB_OUTPUT" |
| 82 | + # id: skip-ci |
| 83 | + |
| 84 | + # - name: Log skip CI result |
| 85 | + # run: echo "${{steps.skip-ci.outputs.RESULT}}" |
| 86 | + |
| 87 | + # - name: Setup Node.js ${{ matrix.node-version }} |
| 88 | + # if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 89 | + # uses: actions/setup-node@v3 |
| 90 | + # with: |
| 91 | + # node-version: ${{ matrix.node-version }} |
| 92 | + # cache: 'pnpm' |
| 93 | + |
| 94 | + # - name: Install Dependencies |
| 95 | + # if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 96 | + # run: pnpm install && cd ./e2e && npx playwright install |
| 97 | + |
| 98 | + # - name: E2E Test |
| 99 | + # if: ${{steps.skip-ci.outputs.RESULT != 'true'}} |
| 100 | + # run: pnpm run e2e |
0 commit comments