Skip to content

Commit f93fc11

Browse files
committed
chore: update GitHub Action to test all routers
Signed-off-by: Thorsten Hans <[email protected]>
1 parent 353daac commit f93fc11

File tree

1 file changed

+58
-62
lines changed

1 file changed

+58
-62
lines changed

.github/workflows/test.yaml

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,80 +2,76 @@ name: Test
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
workflow_dispatch:
99

1010
jobs:
1111
lint_and_test:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
16-
17-
- name: Use Node.js 20
18-
uses: actions/setup-node@v3
19-
with:
20-
node-version: 20
21-
22-
- name: Install depencies
23-
shell: bash
24-
run: npm install
25-
26-
- name: Run prettier check
27-
shell: bash
28-
run: npm run fmt-check
29-
30-
- name: Setup `spin`
31-
uses: fermyon/actions/spin/setup@v1
32-
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Run Test
36-
shell: bash
37-
run: |
38-
cd test
39-
./test.sh
40-
15+
- uses: actions/checkout@v3
16+
17+
- name: Use Node.js 20
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
22+
- name: Install depencies
23+
shell: bash
24+
run: npm install
25+
26+
- name: Run prettier check
27+
shell: bash
28+
run: npm run fmt-check
29+
30+
- name: Setup `spin`
31+
uses: fermyon/actions/spin/setup@v1
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: Run Test
36+
shell: bash
37+
run: |
38+
cd test
39+
./test.sh
40+
4141
test_template:
4242
runs-on: ${{ matrix.os }}
4343
strategy:
4444
matrix:
4545
os: [ubuntu-latest, macos-latest, windows-latest]
46+
router: ['hono', 'itty', 'none']
4647

4748
steps:
48-
- uses: actions/checkout@v3
49-
50-
- name: Use Node.js 20
51-
uses: actions/setup-node@v3
52-
with:
53-
node-version: 20
54-
55-
- name: Setup `spin`
56-
uses: fermyon/actions/spin/setup@v1
57-
with:
58-
github_token: ${{ secrets.GITHUB_TOKEN }}
59-
60-
- name: Install templates
61-
run: spin templates install --dir .
62-
63-
- name: Create new project
64-
run: spin new -t http-ts test-project -a
65-
66-
- name: Install dependencies of the test project
67-
run: |
68-
cd test-project
69-
npm install
70-
71-
- name: Add new component to project
72-
run: |
73-
cd test-project
74-
spin add -t http-ts new-component -a
75-
cd new-component
76-
npm install
77-
78-
- name: Build the application
79-
run: |
80-
cd test-project
81-
spin build
49+
- uses: actions/checkout@v3
50+
51+
- name: Use Node.js 22
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: 22
55+
56+
- name: Setup `spin`
57+
uses: fermyon/actions/spin/setup@v1
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Install templates
62+
run: spin templates install --dir .
63+
64+
- name: Create new project
65+
run: spin new -t http-ts --value http-router=${{ matrix.router }} -a test-project
66+
67+
- name: Add new component to project
68+
run: |
69+
cd test-project
70+
spin add -t http-ts --value http-router=${{ matrix.router }} -a new-component
71+
cd new-component
72+
npm install
73+
74+
- name: Build the application
75+
run: |
76+
cd test-project
77+
spin build

0 commit comments

Comments
 (0)