diff --git a/.github/workflows/node-pretest.yml b/.github/workflows/node-pretest.yml index bd289d9..765edf7 100644 --- a/.github/workflows/node-pretest.yml +++ b/.github/workflows/node-pretest.yml @@ -1,26 +1,7 @@ -name: "Tests: pretest/posttest" +name: 'Tests: pretest/posttest' on: [pull_request, push] jobs: - pretest: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: ljharb/actions/node/install@main - name: "nvm install ${{ matrix.node-version }} && npm install" - with: - node-version: "lts/*" - - run: npm run pretest - - posttest: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: ljharb/actions/node/install@main - name: "nvm install ${{ matrix.node-version }} && npm install" - with: - node-version: "lts/*" - - run: npm run posttest + tests: + uses: ljharb/actions/.github/workflows/pretest.yml@main diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 090dee1..dc38026 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -1,60 +1,18 @@ -name: "Tests: node.js" +name: 'Tests: node.js >= 14' on: [pull_request, push] jobs: - matrix: - runs-on: ubuntu-latest - outputs: - latest: ${{ steps.set-matrix.outputs.requireds }} - minors: ${{ steps.set-matrix.outputs.optionals }} - steps: - - uses: ljharb/actions/node/matrix@main - id: set-matrix - with: - preset: ">=14" - - latest: - needs: [matrix] - name: "latest minors" - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.latest) }} - - steps: - - uses: actions/checkout@v2 - - uses: ljharb/actions/node/install@main - name: "nvm install ${{ matrix.node-version }} && npm install" - with: - node-version: ${{ matrix.node-version }} - - run: npm run tests-only - - uses: codecov/codecov-action@v2 - - minors: - needs: [matrix, latest] - name: "non-latest minors" - continue-on-error: true - if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix.outputs.minors) }} - - steps: - - uses: actions/checkout@v2 - - uses: ljharb/actions/node/install@main - name: "nvm install ${{ matrix.node-version }} && npm install" - with: - node-version: ${{ matrix.node-version }} - - run: npm run tests-only - - uses: codecov/codecov-action@v2 + tests: + uses: ljharb/actions/.github/workflows/node.yml@main + with: + range: '>= 14' + type: minors + command: npm run tests-only node: - name: "node 14+" - needs: [latest, minors] + name: 'node >= 14' + needs: [tests] runs-on: ubuntu-latest steps: - - run: "echo tests completed" + - run: 'echo tests completed'