File tree Expand file tree Collapse file tree 4 files changed +56
-29
lines changed
Expand file tree Collapse file tree 4 files changed +56
-29
lines changed Original file line number Diff line number Diff line change 1+ name : Run Tests
2+
3+ inputs :
4+ node-version :
5+ required : true
6+ type : string
7+
8+ runs :
9+ using : composite
10+ steps :
11+ - uses : actions/checkout@v4
12+ - uses : actions/setup-node@v4
13+ with :
14+ node-version : ${{ inputs.node-version }}
15+ - run : npm i -g pnpm
16+ shell : bash
17+ - run : pnpm i --ignore-scripts
18+ shell : bash
19+ - run : pnpm cypress:install
20+ shell : bash
21+ - run : pnpm lint
22+ shell : bash
23+ - run : pnpm test
24+ shell : bash
25+ - name : Save Cypress output on failure
26+ if : ${{ failure() }}
27+ uses : actions/upload-artifact@v4
28+ with :
29+ name : cypress-output
30+ path : |
31+ cypress/screenshots/
32+ cypress/videos/
33+ cypress/downloads/
34+ retention-days : 7
Original file line number Diff line number Diff line change @@ -2,32 +2,16 @@ name: PR Tests
22
33on :
44 pull_request :
5- branches : [ " main" ]
5+ branches : [main]
66
77jobs :
8- tests :
8+ run- tests :
99 runs-on : ubuntu-latest
1010 strategy :
1111 matrix :
1212 node-version : [22.x]
1313 steps :
14- - uses : actions/checkout@v4
15- - name : Use Node.js ${{ matrix.node-version }}
16- uses : actions/setup-node@v4
17- with :
18- node-version : ${{ matrix.node-version }}
19- - run : npm i -g pnpm
20- - run : pnpm i --ignore-scripts
21- - run : pnpm cypress:install
22- - run : pnpm lint
23- - run : pnpm test
24- - name : Save Cypress Output
25- if : ${{ failure() }}
26- uses : actions/upload-artifact@v4
27- with :
28- name : cypress-output
29- path : |
30- cypress/screenshots/
31- cypress/videos/
32- cypress/downloads/
33- retention-days : 7
14+ - uses : actions/checkout@v4
15+ - uses : ./.github/actions/run-tests
16+ with :
17+ node-version : ${{ matrix.node-version }}
Original file line number Diff line number Diff line change 55 types : [created]
66
77jobs :
8+ run-tests :
9+ runs-on : ubuntu-latest
10+ strategy :
11+ matrix :
12+ node-version : [22.x]
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : ./.github/actions/run-tests
16+ with :
17+ node-version : ${{ matrix.node-version }}
18+
819 publish-npm :
20+ needs : run-tests
921 runs-on : ubuntu-latest
1022 strategy :
1123 matrix :
1224 node-version : [22.x]
1325 steps :
1426 - uses : actions/checkout@v4
15- - name : Use Node.js ${{ matrix.node-version }}
16- uses : actions/setup-node@v4
27+ - uses : actions/setup-node@v4
1728 with :
1829 node-version : ${{ matrix.node-version }}
1930 registry-url : https://registry.npmjs.org/
2233 - run : cat package.json
2334 - run : npm i -g pnpm
2435 - run : pnpm i
25- - run : pnpm test
2636 - run : pnpm publish-npm
2737 env :
2838 NODE_AUTH_TOKEN : ${{secrets.NPM_PUBLISH_TOKEN}}
3545 node-version : [22.x]
3646 steps :
3747 - uses : actions/checkout@v4
38- - name : Use Node.js ${{ matrix.node-version }}
39- uses : actions/setup-node@v4
48+ - uses : actions/setup-node@v4
4049 with :
4150 node-version : ${{ matrix.node-version }}
4251 - run : npm i -g pnpm
4958 git config user.name "github-actions-bot"
5059 - name : Deploy to Github Pages
5160 run : |
61+ pnpm build-demo
5262 git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
53- pnpm deploy-demo -- -u "github-actions-bot <[email protected] >" 63+ npx gh-pages -d demo/build -u "github-actions-bot <[email protected] >" 5464 env :
5565 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1818 "publish-npm" : " pnpm clean && pnpm build && npm publish" ,
1919 "start-demo" : " pnpm --prefix demo start" ,
2020 "build-demo" : " pnpm --prefix demo build" ,
21- "deploy-demo" : " pnpm build-demo && gh-pages -d demo/build" ,
2221 "lint" : " eslint ." ,
2322 "cypress:install" : " cypress install" ,
2423 "test" : " pnpm cypress run --component" ,
You can’t perform that action at this time.
0 commit comments