-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
544279a
commit 3300c30
Showing
4 changed files
with
82 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,43 @@ | ||
name: ci | ||
|
||
on: | ||
- pull_request | ||
- push | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '*.md' | ||
pull_request: | ||
paths-ignore: | ||
- '*.md' | ||
|
||
# Cancel in progress workflows | ||
# in the scenario where we already had a run going for that PR/branch/tag but then triggered a new run | ||
concurrency: | ||
group: "${{ github.workflow }} ✨ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: Install dependencies | ||
run: npm install --ignore-scripts --only=dev | ||
|
||
- name: Run lint | ||
run: npm run lint | ||
|
||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
name: | ||
- Node.js 0.8 | ||
- Node.js 0.10 | ||
|
@@ -35,6 +64,7 @@ jobs: | |
- Node.js 20.x | ||
- Node.js 21.x | ||
- Node.js 22.x | ||
- Node.js 23.x | ||
|
||
include: | ||
- name: Node.js 0.8 | ||
|
@@ -107,51 +137,48 @@ jobs: | |
npm-i: [email protected] | ||
|
||
- name: Node.js 15.x | ||
node-version: "15.14" | ||
node-version: "15" | ||
npm-i: [email protected] | ||
|
||
- name: Node.js 16.x | ||
node-version: "16.20" | ||
node-version: "16" | ||
npm-i: [email protected] | ||
|
||
- name: Node.js 17.x | ||
node-version: "17.9" | ||
node-version: "17" | ||
npm-i: [email protected] | ||
|
||
- name: Node.js 18.x | ||
node-version: "18.18" | ||
node-version: "18" | ||
|
||
- name: Node.js 19.x | ||
node-version: "19.9" | ||
node-version: "19" | ||
|
||
- name: Node.js 20.x | ||
node-version: "20.9" | ||
node-version: "20" | ||
|
||
- name: Node.js 21.x | ||
node-version: "21.1" | ||
node-version: "21" | ||
|
||
- name: Node.js 22.x | ||
node-version: "22.0" | ||
node-version: "22" | ||
|
||
- name: Node.js 23.x | ||
node-version: "23" | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Install Node.js ${{ matrix.node-version }} | ||
shell: bash -eo pipefail -l {0} | ||
run: | | ||
nvm install --default ${{ matrix.node-version }} | ||
if [[ "${{ matrix.node-version }}" == 0.* && "$(cut -d. -f2 <<< "${{ matrix.node-version }}")" -lt 10 ]]; then | ||
nvm install --alias=npm 0.10 | ||
nvm use ${{ matrix.node-version }} | ||
if [[ "$(npm -v)" == 1.1.* ]]; then | ||
nvm exec npm npm install -g [email protected] | ||
ln -fs "$(which npm)" "$(dirname "$(nvm which npm)")/npm" | ||
else | ||
sed -i '1s;^.*$;'"$(printf '#!%q' "$(nvm which npm)")"';' "$(readlink -f "$(which npm)")" | ||
fi | ||
npm config set strict-ssl false | ||
fi | ||
dirname "$(nvm which ${{ matrix.node-version }})" >> "$GITHUB_PATH" | ||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Npm version fixes | ||
if: ${{matrix.npm-version != ''}} | ||
run: npm install -g ${{ matrix.npm-version }} | ||
|
||
- name: Configure npm | ||
run: | | ||
|
@@ -202,24 +229,39 @@ jobs: | |
npm test | ||
fi | ||
- name: Lint code | ||
if: steps.list_env.outputs.eslint != '' | ||
run: npm run lint | ||
|
||
- name: Collect code coverage | ||
uses: coverallsapp/github-action@master | ||
- name: Upload code coverage | ||
if: steps.list_env.outputs.nyc != '' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
flag-name: run-${{ matrix.test_number }} | ||
parallel: true | ||
name: coverage-node-${{ matrix.node-version }} | ||
path: ./coverage/lcov.info | ||
retention-days: 1 | ||
|
||
coverage: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
checks: write | ||
steps: | ||
- name: Upload code coverage | ||
uses: coverallsapp/github-action@master | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install lcov | ||
shell: bash | ||
run: sudo apt-get -y install lcov | ||
|
||
- name: Collect coverage reports | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./coverage | ||
pattern: coverage-node-* | ||
|
||
- name: Merge coverage reports | ||
shell: bash | ||
run: find ./coverage -name lcov.info -exec printf '-a %q\n' {} \; | xargs lcov -o ./lcov.info | ||
|
||
- name: Upload coverage report | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
parallel-finished: true | ||
file: ./lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters