|
41 | 41 | - "!**/_meta.json" |
42 | 42 | - "!**/dictionary.txt" |
43 | 43 |
|
| 44 | + # ======== lint ======== |
| 45 | + lint: |
| 46 | + if: github.event_name != 'schedule' |
| 47 | + runs-on: ubuntu-latest |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Checkout |
| 51 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 52 | + with: |
| 53 | + fetch-depth: 1 |
| 54 | + |
| 55 | + - name: Install pnpm |
| 56 | + run: | |
| 57 | + npm install -g corepack@latest --force |
| 58 | + corepack enable |
| 59 | +
|
| 60 | + - name: Setup Node.js |
| 61 | + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 |
| 62 | + with: |
| 63 | + node-version: 22 |
| 64 | + cache: 'pnpm' |
| 65 | + |
| 66 | + - name: Install Dependencies |
| 67 | + run: pnpm install --ignore-scripts |
| 68 | + |
| 69 | + - name: Build Packages |
| 70 | + run: pnpm run build |
| 71 | + |
| 72 | + - name: Lint |
| 73 | + run: pnpm run lint |
| 74 | + |
| 75 | + - name: Check Dependency Version |
| 76 | + run: pnpm run check-dependency-version |
| 77 | + |
| 78 | + - name: Check pnpm Dedupe |
| 79 | + run: pnpm dedupe --check |
| 80 | + |
| 81 | + - name: Check Unused Code |
| 82 | + run: pnpm run check-unused |
| 83 | + |
44 | 84 | # ======== ut ======== |
45 | 85 | ut: |
46 | 86 | needs: prepare |
@@ -103,8 +143,12 @@ jobs: |
103 | 143 |
|
104 | 144 | # ======== e2e ======== |
105 | 145 | e2e: |
106 | | - needs: [prepare, ut] |
107 | | - if: needs.prepare.outputs.changed == 'true' || github.event_name == 'schedule' |
| 146 | + needs: [prepare, lint, ut] |
| 147 | + if: | |
| 148 | + always() && |
| 149 | + (needs.prepare.outputs.changed == 'true' || github.event_name == 'schedule') && |
| 150 | + needs.ut.result == 'success' && |
| 151 | + (github.event_name == 'schedule' || needs.lint.result == 'success') |
108 | 152 | runs-on: ${{ matrix.os }} |
109 | 153 | timeout-minutes: 15 |
110 | 154 | strategy: |
@@ -168,12 +212,17 @@ jobs: |
168 | 212 |
|
169 | 213 | # ======== gate ======== |
170 | 214 | test-gate: |
171 | | - needs: [prepare, ut, e2e] |
| 215 | + needs: [prepare, lint, ut, e2e] |
172 | 216 | if: always() |
173 | 217 | runs-on: ubuntu-latest |
174 | 218 | steps: |
175 | 219 | - name: Check test requirement |
176 | 220 | run: | |
177 | | - if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ needs.prepare.outputs.changed }}" = "true" ]; then |
178 | | - [ "${{ needs.ut.result }}" = "success" ] && [ "${{ needs.e2e.result }}" = "success" ] |
179 | | - fi |
| 221 | + for result in \ |
| 222 | + "${{ needs.lint.result }}" \ |
| 223 | + "${{ needs.ut.result }}" \ |
| 224 | + "${{ needs.e2e.result }}"; do |
| 225 | + if [ "$result" = "failure" ] || [ "$result" = "cancelled" ]; then |
| 226 | + exit 1 |
| 227 | + fi |
| 228 | + done |
0 commit comments