Skip to content

Commit

Permalink
add github actions yml
Browse files Browse the repository at this point in the history
  • Loading branch information
doehyunbaek committed Nov 24, 2023
1 parent eebce27 commit 3b313fa
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/offline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: offline tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: jetli/[email protected]
with:
version: 'latest'
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '19.x'
- run: npm install
- run: npm run build-full
- run: npm test offline node
if: always()
- run: find ${GITHUB_WORKSPACE} -name "report.txt" -exec cp {} ${GITHUB_WORKSPACE}/reports \;
if: always()
- name: Upload report.txt files
uses: actions/upload-artifact@v3
with:
name: report-files
path: ${GITHUB_WORKSPACE}/reports
25 changes: 25 additions & 0 deletions .github/workflows/online.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: online tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: jetli/[email protected]
with:
version: 'latest'
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '19.x'
- run: npm install
- run: npm run build-full
- run: npm test online
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"build": "tsc && node ./build.js",
"build-wasabi": "git submodule init && git submodule update --remote && cd wasabi/crates/wasabi_js && npm run build && wasm-pack build --target web && wasm-pack build --target nodejs --out-dir ../../../dist/wasabi && cd ../../..",
"build-wasabi": "cd wasabi/crates/wasabi_js && npm run build && wasm-pack build --target web && wasm-pack build --target nodejs --out-dir ../../../dist/wasabi && cd ../../..",
"build-full": "npm run build-wasabi && npm run build",
"test": "npm run build && node ./dist/tests/run-tests.cjs",
"clean-tests": "node ./dist/tests/clean-tests.cjs",
Expand Down
5 changes: 5 additions & 0 deletions tests/run-tests.cts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ async function runOnlineTests(names: string[]) {
'ffmpeg',
'sandspiel',
'image-convolute',
'guiicons',
'handy-tools',
'riconpacker',
'rtexviewer',
'javascriptcore',
]
names = names.filter((n) => !filter.includes(n))
Expand Down Expand Up @@ -227,6 +231,7 @@ async function writeReport(name: string, report: TestReport) {
process.stdout.write(`\u2713\n`)
} else {
process.stdout.write(`\u2717\t\t${testReportPath}\n`)
process.exitCode = 1
await fs.writeFile(testReportPath, report.reason)
}
}
Expand Down

0 comments on commit 3b313fa

Please sign in to comment.