Skip to content

Commit

Permalink
chore(ci): update test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari committed Sep 2, 2023
1 parent 9dc3e2c commit e1c6e4c
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 17 deletions.
68 changes: 52 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test
on: [push, pull_request]

jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -12,29 +12,65 @@ jobs:
with:
node-version-file: ".node-version"

- uses: pnpm/action-setup@v2
name: Install pnpm
- run: |
wget -P ${{ runner.temp }} https://github.com/tinygo-org/tinygo/releases/download/v0.28.1/tinygo_0.28.1_amd64.deb
yes | sudo dpkg -i ${{ runner.temp }}/tinygo_0.28.1_amd64.deb
- run: npm run build
- run: npm pack
- name: Upload
uses: actions/upload-artifact@v3
with:
name: build
path: |
gofmt.js
gofmt.wasm
*.tgz
deno-test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build
path: ./

- uses: denoland/setup-deno@v1
name: Install Deno
with:
deno-version: v1.x

- uses: oven-sh/setup-bun@v1
name: Install bun
- run: deno test test_deno --allow-read

- run: |
wget -P ${{ runner.temp }} https://github.com/tinygo-org/tinygo/releases/download/v0.28.1/tinygo_0.28.1_amd64.deb
yes | sudo dpkg -i ${{ runner.temp }}/tinygo_0.28.1_amd64.deb
node-test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: build
path: ./

- run: npm run build
- run: pnpm run /^test:/
- uses: actions/setup-node@v3
name: Install Node
with:
node-version-file: ".node-version"

- name: Package
run: npm pack
- run: node --test test_node

- name: Upload
uses: actions/upload-artifact@v3
bun-test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: |
wasm-fmt-*.tgz
name: build
path: ./

- uses: oven-sh/setup-bun@v1
name: Install bun

- run: bun test test_bun
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"test:deno": "deno test test_deno --allow-read",
"test:bun": "bun test test_bun"
},
"packageManager": "pnpm@8.7.1",
"engines": {
"node": ">=16.17.0"
},
Expand Down

0 comments on commit e1c6e4c

Please sign in to comment.