From a6fbf4f02683ba018b99d447f39e38904670966b Mon Sep 17 00:00:00 2001 From: Piotr Roslaniec Date: Mon, 29 Apr 2024 12:49:00 +0200 Subject: [PATCH] chore(ci): test nodejs compatibility across different versions --- .github/workflows/nucypher-core.yml | 52 ++++++++++++++++++++++++----- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nucypher-core.yml b/.github/workflows/nucypher-core.yml index e6a8214..b6ea1bc 100644 --- a/.github/workflows/nucypher-core.yml +++ b/.github/workflows/nucypher-core.yml @@ -66,29 +66,65 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + node-version: [18, 20, 22] rust: - stable target: - wasm32-unknown-unknown - steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@v1 with: toolchain: ${{ matrix.rust }} targets: ${{ matrix.target }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: Install Yarn + run: npm install -g yarn - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - run: make working-directory: nucypher-core-wasm - - uses: borales/actions-yarn@v3.0.0 + - run: yarn install + working-directory: nucypher-core-wasm/examples/node + - run: yarn build + working-directory: nucypher-core-wasm/examples/node + - run: yarn test + working-directory: nucypher-core-wasm/examples/node + + # Tests for compatibility across different versions of Node.js + yarn-test-node-22: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [ 18, 20, 22 ] + rust: + - stable + target: + - wasm32-unknown-unknown + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@v1 with: - cmd: --cwd nucypher-core-wasm/examples/node install - - uses: borales/actions-yarn@v3.0.0 + toolchain: ${{ matrix.rust }} + targets: ${{ matrix.target }} + - uses: actions/setup-node@v4 with: - cmd: --cwd nucypher-core-wasm/examples/node build - - uses: borales/actions-yarn@v3.0.0 + node-version: 22 + - name: Install Yarn + run: npm install -g yarn + - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - run: make + working-directory: nucypher-core-wasm + - run: yarn install + working-directory: nucypher-core-wasm/examples/node + - run: yarn build + working-directory: nucypher-core-wasm/examples/node + - uses: actions/setup-node@v4 with: - cmd: --cwd nucypher-core-wasm/examples/node test + node-version: ${{ matrix.node-version }} + - run: yarn test + working-directory: nucypher-core-wasm/examples/node rebundle-wasm: runs-on: ubuntu-latest