From c071d9cfc63545579d16adfa94e679c4e48ce826 Mon Sep 17 00:00:00 2001 From: Oscar Dominguez Date: Fri, 15 Jul 2022 12:16:17 +0200 Subject: [PATCH] feat(workflows): feat(workflows): create 'test.yml' reusable workflow --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7f8906f --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: + workflow_call: + inputs: + node_versions: + required: true + type: string + +jobs: + test_matrix: + runs-on: ubuntu-latest + strategy: + matrix: + node_version: + - 14 + - 16 + - 18 + 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