Skip to content

Commit 676e048

Browse files
committed
chore: update GitHub Action to test all routers
Signed-off-by: Thorsten Hans <[email protected]>
1 parent 8c36e4b commit 676e048

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,9 +2,9 @@ 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
env:
@@ -15,21 +15,21 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v3
19-
20-
- name: Install Rust toolchain
21-
shell: bash
22-
run: |
23-
rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update
24-
rustup default ${{ env.RUST_VERSION }}
25-
26-
- name: "Install Wasm Rust target"
27-
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
28-
29-
- name: Use Node.js 22
30-
uses: actions/setup-node@v3
31-
with:
32-
node-version: 22
18+
- uses: actions/checkout@v3
19+
20+
- name: Install Rust toolchain
21+
shell: bash
22+
run: |
23+
rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update
24+
rustup default ${{ env.RUST_VERSION }}
25+
26+
- name: 'Install Wasm Rust target'
27+
run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }}
28+
29+
- name: Use Node.js 22
30+
uses: actions/setup-node@v3
31+
with:
32+
node-version: 22
3333

3434
# - name: Install dependencies
3535
# shell: bash
@@ -39,55 +39,51 @@ jobs:
3939
# shell: bash
4040
# run: npm run fmt-check
4141

42-
- name: Setup `spin`
43-
uses: fermyon/actions/spin/setup@v1
44-
with:
45-
github_token: ${{ secrets.GITHUB_TOKEN }}
46-
47-
- name: Run Test
48-
shell: bash
49-
run: |
50-
cd test
51-
./test.sh
52-
42+
- name: Setup `spin`
43+
uses: fermyon/actions/spin/setup@v1
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
- name: Run Test
48+
shell: bash
49+
run: |
50+
cd test
51+
./test.sh
52+
5353
test_template:
5454
runs-on: ${{ matrix.os }}
5555
strategy:
5656
matrix:
5757
os: [ubuntu-latest, macos-latest, windows-latest]
58+
router: ['hono', 'itty', 'none']
5859

5960
steps:
60-
- uses: actions/checkout@v3
61-
62-
- name: Use Node.js 22
63-
uses: actions/setup-node@v3
64-
with:
65-
node-version: 22
66-
67-
- name: Setup `spin`
68-
uses: fermyon/actions/spin/setup@v1
69-
with:
70-
github_token: ${{ secrets.GITHUB_TOKEN }}
71-
72-
- name: Install templates
73-
run: spin templates install --dir .
74-
75-
- name: Create new project
76-
run: spin new -t http-ts test-project -a
77-
78-
- name: Install dependencies of the test project
79-
run: |
80-
cd test-project
81-
npm install
82-
83-
- name: Add new component to project
84-
run: |
85-
cd test-project
86-
spin add -t http-ts new-component -a
87-
cd new-component
88-
npm install
89-
90-
- name: Build the application
91-
run: |
92-
cd test-project
93-
spin build
61+
- uses: actions/checkout@v3
62+
63+
- name: Use Node.js 22
64+
uses: actions/setup-node@v3
65+
with:
66+
node-version: 22
67+
68+
- name: Setup `spin`
69+
uses: fermyon/actions/spin/setup@v1
70+
with:
71+
github_token: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Install templates
74+
run: spin templates install --dir .
75+
76+
- name: Create new project
77+
run: spin new -t http-ts --value http-router=${{ matrix.router }} -a test-project
78+
79+
- name: Add new component to project
80+
run: |
81+
cd test-project
82+
spin add -t http-ts --value http-router=${{ matrix.router }} -a new-component
83+
cd new-component
84+
npm install
85+
86+
- name: Build the application
87+
run: |
88+
cd test-project
89+
spin build

0 commit comments

Comments
 (0)