Skip to content

Commit 27a16cb

Browse files
committed
ci: improve self-hosted CI workflow
- Specify `linux` runner - Add `timeout-minutes` to lint and test jobs - Add `cleanup` job to remove workspace files
1 parent ed35511 commit 27a16cb

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/self-hosted-test.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ on:
99
jobs:
1010
lint:
1111
name: Lint
12-
runs-on: [self-hosted]
12+
runs-on: [self-hosted, linux]
13+
timeout-minutes: 10
1314
steps:
1415
- name: Checkout code
1516
uses: actions/checkout@v4
@@ -32,7 +33,8 @@ jobs:
3233

3334
test:
3435
name: Test
35-
runs-on: [self-hosted]
36+
runs-on: [self-hosted, linux]
37+
timeout-minutes: 15
3638
needs: lint
3739
steps:
3840
- name: Checkout code
@@ -55,3 +57,16 @@ jobs:
5557
run: npm test
5658
env:
5759
CI: true
60+
61+
cleanup:
62+
name: Cleanup
63+
runs-on: [self-hosted, linux]
64+
needs: [lint, test]
65+
if: always()
66+
steps:
67+
- name: Clean workspace
68+
run: |
69+
rm -rf node_modules/
70+
rm -rf .npm/
71+
npm cache clean --force
72+
continue-on-error: true

0 commit comments

Comments
 (0)