|
7 | 7 | branches: |
8 | 8 | - main |
9 | 9 |
|
10 | | -permissions: |
11 | | - contents: read # to fetch code (actions/checkout) |
12 | | - |
13 | 10 | jobs: |
14 | | - unit-test: |
15 | | - runs-on: ubuntu-latest |
16 | | - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
17 | | - env: |
18 | | - PUPPETEER_SKIP_DOWNLOAD: 'true' |
19 | | - steps: |
20 | | - - uses: actions/checkout@v4 |
21 | | - |
22 | | - - name: Install pnpm |
23 | | - uses: pnpm/action-setup@v4.0.0 |
24 | | - |
25 | | - - name: Install Node.js |
26 | | - uses: actions/setup-node@v4 |
27 | | - with: |
28 | | - node-version-file: '.node-version' |
29 | | - cache: 'pnpm' |
30 | | - |
31 | | - - run: pnpm install |
32 | | - |
33 | | - - name: Run unit tests |
34 | | - run: pnpm run test-unit |
35 | | - |
36 | | - lint-and-test-dts: |
37 | | - runs-on: ubuntu-latest |
38 | | - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
39 | | - env: |
40 | | - PUPPETEER_SKIP_DOWNLOAD: 'true' |
41 | | - steps: |
42 | | - - uses: actions/checkout@v4 |
43 | | - |
44 | | - - name: Install pnpm |
45 | | - uses: pnpm/action-setup@v4.0.0 |
46 | | - |
47 | | - - name: Install Node.js |
48 | | - uses: actions/setup-node@v4 |
49 | | - with: |
50 | | - node-version-file: '.node-version' |
51 | | - cache: 'pnpm' |
52 | | - |
53 | | - - run: pnpm install |
54 | | - |
55 | | - - name: Run eslint |
56 | | - run: pnpm run lint |
57 | | - |
58 | | - - name: Run prettier |
59 | | - run: pnpm run format-check |
60 | | - |
61 | | - - name: Run type declaration tests |
62 | | - run: pnpm run test-dts |
63 | | - |
64 | | - release: |
65 | | - runs-on: ubuntu-latest |
66 | | - needs: [unit-test, lint-and-test-dts] |
67 | | - permissions: |
68 | | - contents: read |
69 | | - id-token: write |
70 | | - steps: |
71 | | - - uses: actions/checkout@v4 |
72 | | - |
73 | | - - name: Install pnpm |
74 | | - uses: pnpm/action-setup@v2 |
75 | | - |
76 | | - - name: Install Node.js |
77 | | - uses: actions/setup-node@v4 |
78 | | - with: |
79 | | - node-version-file: '.node-version' |
80 | | - registry-url: 'https://registry.npmjs.org' |
81 | | - cache: 'pnpm' |
82 | | - |
83 | | - - run: pnpm install |
84 | | - |
85 | | - - name: Build |
86 | | - run: pnpm build --withTypes |
87 | | - |
88 | | - - name: Publish |
89 | | - run: pnpm dlx pkg-pr-new@0.0 publish './packages/*' --template './playground' --pnpm |
90 | | - |
91 | | - # benchmarks: |
92 | | - # runs-on: ubuntu-latest |
93 | | - # if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository |
94 | | - # env: |
95 | | - # PUPPETEER_SKIP_DOWNLOAD: 'true' |
96 | | - # steps: |
97 | | - # - uses: actions/checkout@v4 |
98 | | - |
99 | | - # - name: Install pnpm |
100 | | - # uses: pnpm/action-setup@v3.0.0 |
101 | | - |
102 | | - # - name: Install Node.js |
103 | | - # uses: actions/setup-node@v4 |
104 | | - # with: |
105 | | - # node-version-file: '.node-version' |
106 | | - # cache: 'pnpm' |
107 | | - |
108 | | - # - run: pnpm install |
109 | | - |
110 | | - # - name: Run benchmarks |
111 | | - # uses: CodSpeedHQ/action@v2 |
112 | | - # with: |
113 | | - # run: pnpm vitest bench --run |
114 | | - # token: ${{ secrets.CODSPEED_TOKEN }} |
| 11 | + test: |
| 12 | + if: ${{ ! startsWith(github.event.head_commit.message, 'release:') && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) }} |
| 13 | + uses: ./.github/workflows/test.yml |
0 commit comments