Skip to content

Commit

Permalink
wip: use shared run action
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 3, 2020
1 parent 9354e0d commit 72e08c3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 167 deletions.
39 changes: 5 additions & 34 deletions .github/workflows/node-4+.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
with:
node-version: ${{ matrix.node-version }}
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'
minors:
needs: [matrix, latest]
name: 'non-latest minors'
Expand All @@ -55,25 +41,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
with:
node-version: ${{ matrix.node-version }}
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'

node:
name: 'node 4+'
Expand Down
34 changes: 6 additions & 28 deletions .github/workflows/node-iojs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
with:
node-version: ${{ matrix.node-version }}
- name: 'upgrade npm, npm install'
run: . /home/runner/mynvm/nvm.sh && nvm install-latest-npm
- run: npm install
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'
minors:
needs: [matrix, latest]
name: 'non-latest minors'
Expand All @@ -45,29 +41,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
with:
node-version: ${{ matrix.node-version }}
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
case "${{ matrix.node-version }}" in
0.* ) export NPM_CONFIG_STRICT_SSL=false ;;
esac
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm install
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'

node:
name: 'io.js'
Expand Down
44 changes: 8 additions & 36 deletions .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,19 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js `lts/*`
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run pretest'
with:
node-version: "lts/*"
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run pretest
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
node-version: 'lts/*'
command: 'pretest'

posttest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js `lts/*`
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run posttest'
with:
node-version: "lts/*"
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run posttest
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
node-version: 'lts/*'
command: 'posttest'
58 changes: 6 additions & 52 deletions .github/workflows/node-zero.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
- if: steps.cache_node_modules.cache-hit != 'true'
name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
case "${{ matrix.node-version }}" in
0.* ) export NPM_CONFIG_STRICT_SSL=false ;;
esac
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
unstable:
needs: [matrix, stable]
name: 'unstable minors'
Expand All @@ -65,33 +41,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache_node_modules
uses: actions/cache@v1
with:
path: node_modules
key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
- if: steps.cache_node_modules.cache-hit != 'true'
name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
case "${{ matrix.node-version }}" in
0.* ) export NPM_CONFIG_STRICT_SSL=false ;;
esac
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.6|0.7|0.9) nvm install --latest-npm 0.8 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run tests-only
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'tests-only'
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}

node:
name: 'node 0.x'
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/ses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: dcodeIO/setup-node-nvm@master
name: Use Node.js ${{ matrix.node-version }}
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run test:ses'
with:
node-version: ${{ matrix.node-version }}
- name: 'upgrade npm, npm install'
run: |
. /home/runner/mynvm/nvm.sh
nvm install-latest-npm
export CI_RESET_NODE_VERSION=1
case "${{ matrix.node-version }}" in
0.5|0.5.*|0.6|0.6.*|0.7|0.7.*|0.9|0.9.*) nvm install --latest-npm 0.8 ;;
5.*|6.1|6.2 ) nvm install --latest-npm 6 ;;
9.0|9.1|9.2 ) nvm install --latest-npm 9 ;;
* ) export CI_RESET_NODE_VERSION=0 ;;
esac
npm install
if [ "${CI_RESET_NODE_VERSION-}" = 1 ]; then nvm use "${{ matrix.node-version }}"; fi
- run: npm run test:ses
- run: if [ -f coverage/*.json ]; then bash <(curl -s https://codecov.io/bash) -f coverage/*.json; fi
command: 'test:ses'

SES:
needs: [tests]
Expand Down

0 comments on commit 72e08c3

Please sign in to comment.