diff --git a/.github/actions/install-emsdk/action.yml b/.github/actions/install-emsdk/action.yml new file mode 100644 index 00000000..a2035bfd --- /dev/null +++ b/.github/actions/install-emsdk/action.yml @@ -0,0 +1,22 @@ +name: Install emsdk (including emcc) +inputs: + version: + description: EMCC Version to install + required: false + default: 3.1.28 + +runs: + using: "composite" + steps: + - name: Clone emsdk repo + working-directory: ${{ runner.temp }} + shell: bash + run: git clone https://github.com/emscripten-core/emsdk.git + + - name: emdsk install + working-directory: ${{ runner.temp }}/emsdk + shell: bash + run: | + ./emsdk install ${{ inputs.version }} + ./emsdk activate ${{ inputs.version }} + source $RUNNER_TEMP/emsdk/emsdk_env.sh diff --git a/.github/actions/setup-js/action.yml b/.github/actions/setup-js/action.yml new file mode 100644 index 00000000..fce20c96 --- /dev/null +++ b/.github/actions/setup-js/action.yml @@ -0,0 +1,17 @@ +name: Setup JavaScript envirionment + +runs: + using: "composite" + steps: + - name: Install Node + uses: actions/setup-node@v1 + with: + node-version: 18.x + + - name: Install emsdk + uses: ./.github/actions/install-emsdk + + - name: yarn install + shell: bash + run: yarn install --frozen-lockfile + working-directory: javascript diff --git a/.github/actions/setup-website/action.yml b/.github/actions/setup-website/action.yml index d7cfe42d..0473cee3 100644 --- a/.github/actions/setup-website/action.yml +++ b/.github/actions/setup-website/action.yml @@ -3,11 +3,15 @@ name: Setup Website envirionment runs: using: "composite" steps: - - name: Install NodeJS 12 + # TODO: Update to latest when website is moved to the workspace version of + # yoga-layout + - name: Install Node uses: actions/setup-node@v1 with: node-version: 12.x + # TODO: the website should be in a yarn workspace with the library, but the + # current version of gatsby is incompatible with hoisting. - name: yarn install shell: bash run: yarn install --frozen-lockfile diff --git a/.github/workflows/validate-js.yml b/.github/workflows/validate-js.yml new file mode 100644 index 00000000..da62cf4d --- /dev/null +++ b/.github/workflows/validate-js.yml @@ -0,0 +1,27 @@ +name: JavaScript + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + name: Build + Test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-js + + - name: yarn build + run: yarn build + working-directory: javascript + + - name: yarn test + run: yarn test + working-directory: javascript