Skip to content

Commit

Permalink
ci: Migrate from istanbul to nyc; add lint job to CI (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
vahidalizad authored Oct 21, 2024
1 parent 0e0d721 commit abad05e
Show file tree
Hide file tree
Showing 7 changed files with 2,688 additions and 556 deletions.
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

0 comments on commit abad05e

Please sign in to comment.