From 76cc30a90956b53a0eb1f8b8be6f91c81d49c050 Mon Sep 17 00:00:00 2001 From: Atsushi Watanabe Date: Mon, 4 Mar 2024 12:57:02 +0900 Subject: [PATCH] Fix node version for test with Go 1.20 Go 1.20's wasm_exec_node.js isn't compatible with Node v20 --- .github/workflows/test-wasm.reusable.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-wasm.reusable.yml b/.github/workflows/test-wasm.reusable.yml index 0731e3e..a68fffb 100644 --- a/.github/workflows/test-wasm.reusable.yml +++ b/.github/workflows/test-wasm.reusable.yml @@ -19,11 +19,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: '20.x' - - uses: actions/cache@v4 with: path: | @@ -42,6 +37,20 @@ jobs: ) curl -sSfL https://dl.google.com/go/${version}.linux-amd64.tar.gz | tar -C ~ -xzf - + - name: Node version + id: node-version + run: | + if [ '${{ inputs.go-version }}' = '1.20' ]; then + # Go 1.20's wasm_exec_node.js doesn't work with Node v20 + # This can be removed once all pion repositories are switched to use Go 1.22 + echo 'version=16' | tee -a ${GITHUB_OUTPUT} + fi + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: '${{ steps.node-version.outputs.version || 20 }}.x' + - name: Set Go Root run: echo "GOROOT=${HOME}/go" >> $GITHUB_ENV