From 660317fd059f9b83980181ea1067b99d94c40351 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 21 Jan 2021 11:01:53 -0800 Subject: [PATCH] [Tests] migrate tests to Github Actions --- .github/workflows/node-4+.yml | 62 ++++++++++++++++++++++ .github/workflows/node-iojs.yml | 58 ++++++++++++++++++++ .github/workflows/node-native.yml | 40 ++++++++++++++ .github/workflows/node-pretest.yml | 26 +++++++++ .github/workflows/node-promise-shimmed.yml | 32 +++++++++++ .github/workflows/node-zero.yml | 58 ++++++++++++++++++++ .travis.yml | 23 -------- 7 files changed, 276 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/node-4+.yml create mode 100644 .github/workflows/node-iojs.yml create mode 100644 .github/workflows/node-native.yml create mode 100644 .github/workflows/node-pretest.yml create mode 100644 .github/workflows/node-promise-shimmed.yml create mode 100644 .github/workflows/node-zero.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/node-4+.yml b/.github/workflows/node-4+.yml new file mode 100644 index 0000000..e3eafd9 --- /dev/null +++ b/.github/workflows/node-4+.yml @@ -0,0 +1,62 @@ +name: 'Tests: node.js' + +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: + versionsAsRoot: true + preset: '>=4' + + latest: + needs: [matrix] + name: 'latest minors' + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: ${{ fromJson(needs.matrix.outputs.latest) }} + include: + - node-version: 0.12 + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run tests-only' + with: + node-version: ${{ matrix.node-version }} + command: 'tests-only' + + 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: + matrix: + node-version: ${{ fromJson(needs.matrix.outputs.minors) }} + include: + - node-version: 0.11 + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + with: + node-version: ${{ matrix.node-version }} + command: 'tests-only' + + node: + name: 'node 4+' + needs: [latest, minors] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.github/workflows/node-iojs.yml b/.github/workflows/node-iojs.yml new file mode 100644 index 0000000..f707c3c --- /dev/null +++ b/.github/workflows/node-iojs.yml @@ -0,0 +1,58 @@ +name: 'Tests: node.js (io.js)' + +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: 'iojs' + + latest: + needs: [matrix] + name: 'latest minors' + runs-on: ubuntu-latest + + strategy: + matrix: ${{ fromJson(needs.matrix.outputs.latest) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run tests-only' + with: + node-version: ${{ matrix.node-version }} + command: 'tests-only' + skip-ls-check: true + + 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: + matrix: ${{ fromJson(needs.matrix.outputs.minors) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run tests-only' + with: + node-version: ${{ matrix.node-version }} + command: 'tests-only' + skip-ls-check: true + + node: + name: 'io.js' + needs: [latest, minors] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.github/workflows/node-native.yml b/.github/workflows/node-native.yml new file mode 100644 index 0000000..7a782e0 --- /dev/null +++ b/.github/workflows/node-native.yml @@ -0,0 +1,40 @@ +name: 'Tests: node.js: native' + +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: + type: majors + preset: '>=12' + + majors: + needs: [matrix] + name: 'majors, native tests' + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: ${{ fromJson(needs.matrix.outputs.latest) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run test:native' + with: + node-version: ${{ matrix.node-version }} + command: 'test:native' + + node: + name: 'node, native tests' + needs: [majors] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.github/workflows/node-pretest.yml b/.github/workflows/node-pretest.yml new file mode 100644 index 0000000..3921e0a --- /dev/null +++ b/.github/workflows/node-pretest.yml @@ -0,0 +1,26 @@ +name: 'Tests: pretest/posttest' + +on: [pull_request, push] + +jobs: + pretest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run pretest' + with: + node-version: 'lts/*' + command: 'pretest' + + posttest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run posttest' + with: + node-version: 'lts/*' + command: 'posttest' diff --git a/.github/workflows/node-promise-shimmed.yml b/.github/workflows/node-promise-shimmed.yml new file mode 100644 index 0000000..9dd12e6 --- /dev/null +++ b/.github/workflows/node-promise-shimmed.yml @@ -0,0 +1,32 @@ +name: 'Tests: node.js: shimmed Promise' + +on: [pull_request, push] + +jobs: + majors: + name: 'majors, promise-shimmed tests' + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: + - '0.12' + - '0.11' + - '0.10' + - '0.8' + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + name: 'npm install && npm run test:promise-shimmed' + with: + node-version: ${{ matrix.node-version }} + command: 'test:promise-shimmed' + + node: + name: 'node, promise-shimmed tests' + needs: [majors] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.github/workflows/node-zero.yml b/.github/workflows/node-zero.yml new file mode 100644 index 0000000..94328e0 --- /dev/null +++ b/.github/workflows/node-zero.yml @@ -0,0 +1,58 @@ +name: 'Tests: node.js (0.x)' + +on: [pull_request, push] + +jobs: + matrix: + runs-on: ubuntu-latest + outputs: + stable: ${{ steps.set-matrix.outputs.requireds }} + unstable: ${{ steps.set-matrix.outputs.optionals }} + steps: + - uses: ljharb/actions/node/matrix@main + id: set-matrix + with: + preset: '0.x' + + stable: + needs: [matrix] + name: 'stable minors' + runs-on: ubuntu-latest + + strategy: + matrix: ${{ fromJson(needs.matrix.outputs.stable) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + with: + node-version: ${{ matrix.node-version }} + command: 'test:promise-shimmed' + cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }} + skip-ls-check: true + + unstable: + needs: [matrix, stable] + name: 'unstable minors' + continue-on-error: true + if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }} + runs-on: ubuntu-latest + + strategy: + matrix: ${{ fromJson(needs.matrix.outputs.unstable) }} + + steps: + - uses: actions/checkout@v2 + - uses: ljharb/actions/node/run@main + with: + node-version: ${{ matrix.node-version }} + command: 'test:promise-shimmed' + cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }} + skip-ls-check: true + + node: + name: 'node 0.x' + needs: [stable, unstable] + runs-on: ubuntu-latest + steps: + - run: 'echo tests completed' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 949264e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: ~> 1.0 -language: node_js -os: - - linux -import: - - ljharb/travis-ci:node/minors/gte_4.yml - - ljharb/travis-ci:node/minors/iojs.yml - - ljharb/travis-ci:node/pretest.yml - - ljharb/travis-ci:node/posttest.yml -node_js: - - "0.12" - - "0.11" -script: - - 'if [ -n "${ES5-}" ]; then npm run tests:es5 ; fi' - - 'if [ -n "${NATIVE-}" ]; then npm run test:native ; fi' -matrix: - include: - - node_js: "0.10" - env: ES5=true - - node_js: "node" - env: NATIVE=true ALLOW_FAILURE=true - allow_failures: - - env: NATIVE=true ALLOW_FAILURE=true