diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d26eb13 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +on: + workflow_call: + inputs: + node_versions: + required: true + type: string + +jobs: + test_matrix: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: ${{ fromJson(inputs.node_versions) }} + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + - name: "Test with Node.js ${{ matrix.node_version }}" + uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a # tag=v3 + with: + node-version: "${{ matrix.node_version }}" + cache: npm + - run: npm ci + - run: npm run test --ignore-scripts # run lint only once + test: + runs-on: ubuntu-latest + needs: test_matrix + steps: + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + - run: npm ci + - run: npm run lint --if-present