Install wasm-pack #84
This file contains hidden or 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: Build and test | |
| on: | |
| push: | |
| branches: ["*"] | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| features: | |
| - std | |
| - no_std | |
| - no_std,serde_alloc | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: ${{ matrix.features == 'std' }} | |
| - name: Run tests | |
| run: cargo test --no-default-features --features ${{ matrix.features }} | |
| build-pages: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: Swatinem/rust-cache@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: yarn | |
| cache-dependency-path: mindy-website/www/yarn.lock | |
| - name: Install wasm-pack | |
| working-directory: mindy-website/www | |
| run: yarn global add wasm-pack | |
| - name: Build WASM module | |
| working-directory: mindy-website/www | |
| run: yarn wasm-build-only | |
| - name: Install JS dependencies | |
| working-directory: mindy-website/www | |
| run: yarn install --frozen-lockfile | |
| - name: Build website | |
| working-directory: mindy-website/www | |
| run: yarn build-only | |
| - name: Upload site artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: mindy-website/www/dist/ | |
| deploy-pages: | |
| needs: build-pages | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deploy.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deploy | |
| uses: actions/deploy-pages@v4 |