update links and publish (#151) #71
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull & update submodules | |
run: | | |
git submodule update --init | |
- name: EMSDK Version | |
id: emsdk-version | |
run: | | |
echo "EMSDK_SHA=$(./submodules/emsdk/emsdk list | grep recommended | awk -F'[()]' '{print $2}')" >> $GITHUB_ENV | |
- name: Cache EMSDK | |
id: cache-emsdk | |
uses: actions/cache@v3 | |
with: | |
path: submodules/emsdk | |
key: ${{ runner.os }}-d-emsdk-${{ env.EMSDK_SHA }} | |
restore-keys: | | |
${{ runner.os }}-d-emsdk- | |
- name: Update EMSDK | |
if: steps.cache-emsdk.outputs.cache-hit != 'true' | |
run: | | |
npm run em:update | |
- name: Compile SEAL | |
if: steps.cache-seal.outputs.cache-hit != 'true' | |
run: | | |
npm run build | |
- name: Save artifacts | |
if: steps.cache-seal.outputs.cache-hit != 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: seal-artifacts | |
path: src/bin/ | |
if-no-files-found: error | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install NPM Dependencies | |
run: | | |
npm install | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: seal-artifacts | |
path: src/bin/ | |
- name: Transpile to JavaScript | |
run: | | |
npm run compile | |
- name: Run tests | |
run: | | |
npm run test | |
- name: Generate coverage report | |
run: | | |
npm run coverage | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |