Skip to content

Commit 6e9e000

Browse files
captbaritonefacebook-github-bot
authored andcommitted
Build Wasm compiler explorer when deploying docs website (#3928)
Summary: This ensures that the docs website is always using the latest version of the Relay compiler (`main`) on the website. *Note*: We can't land this until: - [x] We're able to upgrade `parking_lot` (at it's current version it is incompatible with `wasm-pack`) - [ ] Setup a CI job to ensure the compiler playground always builds as part of our internal CI at Meta (otherwise this could easily regress and break deployment of the website) But got this working and I wanted to save my work somewhere. Pull Request resolved: #3928 Reviewed By: mofeiZ Differential Revision: D46699937 Privacy Context Container: L1125407 Pulled By: captbaritone fbshipit-source-id: 8dd9bd5f4d843fe047b5b6d792c45c87ecf7d20f
1 parent 650dfe4 commit 6e9e000

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/docusaurus.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,48 @@ on:
1111
- main
1212

1313
jobs:
14+
build-compiler-explorer:
15+
name: Build Compiler Explorer
16+
runs-on: macos-latest # wasm-pack not working on Ubuntu https://github.com/rustwasm/wasm-pack/issues/781
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: 1.58.0
22+
override: true
23+
- name: Install wasm-pack
24+
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
25+
- name: "Build Compiler Playground Wasm NPM package"
26+
run: wasm-pack build --target web
27+
working-directory: ./compiler/crates/relay-compiler-playground
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
name: compiler-playground-package
31+
path: compiler/crates/relay-compiler-playground/pkg/
32+
1433
build-and-deploy:
1534
runs-on: ubuntu-latest
35+
needs: [build-compiler-explorer]
1636
steps:
1737
- name: Checkout
1838
uses: actions/[email protected]
1939
with:
2040
persist-credentials: false
2141

42+
- name: Download Compiler Explorer
43+
uses: actions/download-artifact@v2
44+
with:
45+
name: compiler-playground-package
46+
path: tmp/compiler-playground-package
47+
48+
- name: Link Compiler Explorer
49+
run: yarn link
50+
working-directory: tmp/compiler-playground-package
51+
2252
- name: Install and Build
2353
run: |
2454
yarn
55+
yarn link relay-compiler-playground
2556
yarn build
2657
working-directory: website/
2758

0 commit comments

Comments
 (0)