Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jnyfah committed Sep 13, 2023
1 parent a2cbe92 commit d7bee9f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 128 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
name: Build and Deploy C++ WebAssembly
name: Build and Deploy C++ WebAssembly to GitHub Pages

on: [push]
on:
push:

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v11
run: emcc -v

- name: Create Build Directory
run: mkdir build

- name: CMake Configure and Build
run: |
cd build
emcmake cmake ..
cmake --build .
# If you want to test using emrun before deploying (this won't display anything but will confirm if it runs without errors)
- name: Test with emrun
run: |
cd web
emrun --no_browser --port 8080 CuriousX.html & # Start in background
sleep 10 # Give some time for the server to start and serve
kill %1 # Kill background job
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: web
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v11
with:
version: latest
run: emcc -v

- name: Create Build Directory
run: mkdir build

- name: Configure and Build using CMake
run: |
cd build
emcmake cmake ..
cmake --build .
# Test to ensure that the web assembly runs without any errors.
- name: Test WebAssembly with emrun
run: |
cd web
emrun --no_browser --port 8080 CuriousX.html & # Start the server in the background
sleep 10 # Wait to ensure the server starts
kill %1 # Terminate the server process
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: web
64 changes: 0 additions & 64 deletions .github/workflows/unittest.yml

This file was deleted.

32 changes: 0 additions & 32 deletions web/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,35 +261,3 @@ function transformJSONToAssembly(commandsArray) {
return assemblyCode;
}

































0 comments on commit d7bee9f

Please sign in to comment.