Skip to content

Commit

Permalink
Build Wasm compiler explorer when deploying docs website (#3928)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
captbaritone authored and facebook-github-bot committed Oct 3, 2023
1 parent 650dfe4 commit 6e9e000
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docusaurus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,48 @@ on:
- main

jobs:
build-compiler-explorer:
name: Build Compiler Explorer
runs-on: macos-latest # wasm-pack not working on Ubuntu https://github.com/rustwasm/wasm-pack/issues/781
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.58.0
override: true
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: "Build Compiler Playground Wasm NPM package"
run: wasm-pack build --target web
working-directory: ./compiler/crates/relay-compiler-playground
- uses: actions/upload-artifact@v3
with:
name: compiler-playground-package
path: compiler/crates/relay-compiler-playground/pkg/

build-and-deploy:
runs-on: ubuntu-latest
needs: [build-compiler-explorer]
steps:
- name: Checkout
uses: actions/checkout@v2.3.1
with:
persist-credentials: false

- name: Download Compiler Explorer
uses: actions/download-artifact@v2
with:
name: compiler-playground-package
path: tmp/compiler-playground-package

- name: Link Compiler Explorer
run: yarn link
working-directory: tmp/compiler-playground-package

- name: Install and Build
run: |
yarn
yarn link relay-compiler-playground
yarn build
working-directory: website/

Expand Down

0 comments on commit 6e9e000

Please sign in to comment.