|
12 | 12 | workflow_dispatch:
|
13 | 13 |
|
14 | 14 | jobs:
|
| 15 | + label: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Check out the repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Determine label |
| 23 | + id: determine_label |
| 24 | + run: | |
| 25 | + if [[ "${{ github.event.pull_request.base.ref }}" == "next" ]]; then |
| 26 | + echo "label=2.x" >> $GITHUB_ENV |
| 27 | + elif [[ "${{ github.event.pull_request.base.ref }}" == "V3.0" ]]; then |
| 28 | + echo "label=3.x" >> $GITHUB_ENV |
| 29 | + fi |
| 30 | +
|
| 31 | + - name: Add label to PR |
| 32 | + uses: actions-ecosystem/action-add-labels@v1 |
| 33 | + with: |
| 34 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + labels: ${{ env.label }} |
15 | 36 | lint:
|
16 | 37 | runs-on: ubuntu-latest
|
17 | 38 | steps:
|
18 |
| - - uses: actions/checkout@v4 |
| 39 | + - uses: actions/checkout@v4 |
19 | 40 |
|
20 |
| - - name: Install pnpm |
21 |
| - run: corepack enable pnpm |
| 41 | + - name: Install pnpm |
| 42 | + run: corepack enable pnpm |
22 | 43 |
|
23 |
| - - uses: actions/setup-node@v4 |
24 |
| - with: |
25 |
| - node-version: '20' |
26 |
| - cache: 'pnpm' |
| 44 | + - uses: actions/setup-node@v4 |
| 45 | + with: |
| 46 | + node-version: '20' |
| 47 | + cache: 'pnpm' |
27 | 48 |
|
28 |
| - - name: Install dependencies |
29 |
| - run: pnpm install |
| 49 | + - name: Install dependencies |
| 50 | + run: pnpm install |
30 | 51 |
|
31 |
| - - name: Run linter |
32 |
| - run: npm run lint |
| 52 | + - name: Run linter |
| 53 | + run: npm run lint |
33 | 54 |
|
34 | 55 | test:
|
35 | 56 | runs-on: ubuntu-latest
|
36 | 57 | steps:
|
37 |
| - - uses: actions/checkout@v4 |
| 58 | + - uses: actions/checkout@v4 |
38 | 59 |
|
39 |
| - - name: Install pnpm |
40 |
| - run: corepack enable pnpm |
| 60 | + - name: Install pnpm |
| 61 | + run: corepack enable pnpm |
41 | 62 |
|
42 |
| - - uses: actions/setup-node@v4 |
43 |
| - with: |
44 |
| - node-version: '20' |
45 |
| - cache: 'pnpm' |
| 63 | + - uses: actions/setup-node@v4 |
| 64 | + with: |
| 65 | + node-version: '20' |
| 66 | + cache: 'pnpm' |
46 | 67 |
|
47 |
| - - name: Install dependencies |
48 |
| - run: pnpm install |
| 68 | + - name: Install dependencies |
| 69 | + run: pnpm install |
49 | 70 |
|
50 |
| - - name: Run test |
51 |
| - run: npm run test |
| 71 | + - name: Run test |
| 72 | + run: npm run test |
52 | 73 |
|
53 |
| - - name: Upload coverage reports to Codecov |
54 |
| - if: ${{ always() }} |
55 |
| - uses: codecov/codecov-action@v4 |
56 |
| - env: |
57 |
| - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
| 74 | + - name: Upload coverage reports to Codecov |
| 75 | + if: ${{ always() }} |
| 76 | + uses: codecov/codecov-action@v4 |
| 77 | + env: |
| 78 | + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
58 | 79 |
|
59 | 80 | build:
|
60 | 81 | runs-on: ubuntu-latest
|
61 | 82 | steps:
|
62 |
| - - uses: actions/checkout@v4 |
| 83 | + - uses: actions/checkout@v4 |
63 | 84 |
|
64 |
| - - name: Install pnpm |
65 |
| - run: corepack enable pnpm |
| 85 | + - name: Install pnpm |
| 86 | + run: corepack enable pnpm |
66 | 87 |
|
67 |
| - - uses: actions/setup-node@v4 |
68 |
| - with: |
69 |
| - node-version: '20' |
70 |
| - cache: 'pnpm' |
| 88 | + - uses: actions/setup-node@v4 |
| 89 | + with: |
| 90 | + node-version: '20' |
| 91 | + cache: 'pnpm' |
71 | 92 |
|
72 |
| - - name: Install dependencies |
73 |
| - run: pnpm install |
| 93 | + - name: Install dependencies |
| 94 | + run: pnpm install |
74 | 95 |
|
75 |
| - - name: Build NutUI-React |
76 |
| - run: npm run build |
| 96 | + - name: Build NutUI-React |
| 97 | + run: npm run build |
77 | 98 |
|
78 |
| - - name: Build NutUI-React-Taro |
79 |
| - run: npm run build:taro |
| 99 | + - name: Build NutUI-React-Taro |
| 100 | + run: npm run build:taro |
80 | 101 |
|
81 |
| - - name: Build NutUI-React Demo |
82 |
| - run: npm run build:site |
| 102 | + - name: Build NutUI-React Demo |
| 103 | + run: npm run build:site |
83 | 104 |
|
84 |
| - - name: Build NutUI-React Taro H5 Demo |
85 |
| - run: npm run build:taro:site |
| 105 | + - name: Build NutUI-React Taro H5 Demo |
| 106 | + run: npm run build:taro:site |
0 commit comments