Skip to content

ci: Migrate from istanbul to nyc; add lint job to CI #225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 44 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,53 @@ on:
branches:
- '**'
jobs:
test:
lint:
name: Lint
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
test:
strategy:
matrix:
node: [ '14', '16', '18' ]
timeout-minutes: 30
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
include:
- name: Node.js 14
NODE_VERSION: 14
- name: Node.js 16
NODE_VERSION: 16
- name: Node.js 18
NODE_VERSION: 18
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Cache Node.js modules
uses: actions/cache@v2
node-version: ${{ matrix.NODE_VERSION }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm run test
- run: ./node_modules/.bin/codecov
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pids
lib-cov

# Coverage directory used by tools like istanbul
.nyc_output
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
Expand Down
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"all": true,
"reporter": [
"lcov",
"text-summary"
],
"include": [
"src/**/*.js"
],
"exclude": [
"**/spec/**"
]
}
18 changes: 18 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"accessKey": "accessKey",
"secretKey": "secretKey",
"insufficientOptions": {
"accessKey": "accessKey",
"secretKey": "secretKey"
},
"bucket": "bucket",
"objectWithBucket": {
"bucket": "bucket"
},
"emptyObject": {},
"paramsObjectWBucket": {
"params": {
"Bucket": "bucket"
}
}
}
Loading