concept-collection / matmul-bench
matmul-bench / .github / workflows / deploy.yml
91 lines · 2.7 KBBlameHistoryRaw
1name: Deploy to GitHub Pages
3on:
4 push:
5 branches:
6 - main
7 workflow_dispatch:
9permissions:
10 contents: read
11 pages: write
12 id-token: write
14concurrency:
15 group: "pages"
16 cancel-in-progress: false
18jobs:
19 build:
20 runs-on: ubuntu-latest
21 steps:
22 - name: Checkout
23 uses: actions/checkout@v4
25 - name: Setup Node
26 uses: actions/setup-node@v4
27 with:
28 node-version: '20'
29 cache: 'npm'
31 - name: Install dependencies
32 run: npm ci
34 - name: Setup emsdk
35 uses: mymindstorm/setup-emsdk@v14
36 with:
37 version: 5.0.4
38 actions-cache-folder: 'emsdk-cache'
40 # libFLAME + BLIS are built from source (WASM) via the sibling
41 # concept-collection/libflame2wasm repo — nothing prebuilt is committed here.
42 - name: Clone libflame2wasm (sibling)
43 run: |
44 git clone --depth 1 https://github.com/concept-collection/libflame2wasm.git "$GITHUB_WORKSPACE/../libflame2wasm"
45 LIBFLAME_DIR="$(cd "$GITHUB_WORKSPACE/../libflame2wasm" && pwd)"
46 echo "LIBFLAME_DIR=$LIBFLAME_DIR" >> "$GITHUB_ENV"
47 echo "LIBFLAME_SHA=$(git -C "$LIBFLAME_DIR" rev-parse HEAD)" >> "$GITHUB_ENV"
49 # Cache the four heavy libflame/BLIS static libraries, keyed on the
50 # libflame2wasm commit + emsdk version. First build is slow (libflame is
51 # compiled twice); afterwards this restores in seconds.
52 - name: Cache libflame2wasm libraries
53 id: libflame-cache
54 uses: actions/cache@v4
55 with:
56 path: |
57 ${{ env.LIBFLAME_DIR }}/install/lib
58 ${{ env.LIBFLAME_DIR }}/blis/lib/generic/libblis.a
59 key: libflame2wasm-${{ env.LIBFLAME_SHA }}-emsdk5.0.4-v1
61 - name: Build libflame2wasm libraries
62 if: steps.libflame-cache.outputs.cache-hit != 'true'
63 run: bash "$LIBFLAME_DIR/build-all-wasm.sh"
65 # Custom C kernels (wasm/dist/matmul.* + public/matmul/matmul_mt.*).
66 - name: Build custom wasm kernels
67 run: bash wasm/build-wasm.sh
69 # libFLAME/BLIS matmul modules (public/matmul/matmul_blis_{st,mt}.*),
70 # linked against the libraries built above.
71 - name: Build BLIS wasm modules
72 run: LIBFLAME="$LIBFLAME_DIR" bash blis/build-blis-wasm.sh
74 - name: Build
75 run: npm run build
77 - name: Upload artifact
78 uses: actions/upload-pages-artifact@v3
79 with:
80 path: ./dist
82 deploy:
83 environment:
84 name: github-pages
85 url: ${{ steps.deployment.outputs.page_url }}
86 runs-on: ubuntu-latest
87 needs: build
88 steps:
89 - name: Deploy to GitHub Pages
90 id: deployment
91 uses: actions/deploy-pages@v4