fix workflow-file #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Emscripten CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Emscripten | |
run: | | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install latest | |
./emsdk activate latest | |
- name: Make build directory | |
run: | | |
mkdir -p build | |
- name: Build fraction module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/fraction.cpp -o build/fraction.js -lembind -std=c++17 -s WASM=2 | |
- name: Build complex module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/complex.cpp -o build/complex.js -lembind -std=c++17 -s WASM=2 | |
- name: Build matrix module | |
run: | | |
source emsdk/emsdk_env.sh | |
emcc src/cpp/matrix.cpp -o build/matrix.js -lembind -std=c++17 -s WASM=2 | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/main' | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git clone --depth 1 --branch gh-pages https://github.com/${{ github.repository }} gh-pages | |
rsync -av --delete build/ gh-pages/ | |
cd gh-pages | |
git add . | |
git commit -m 'Deploy to GitHub Pages' | |
git push origin gh-pages | |