Skip to content

chore: run lint in only one job #195

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 2 commits into from
Feb 20, 2021
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
27 changes: 24 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: run tests
run: yarn travis
run: yarn cover
- uses: codecov/codecov-action@v1
test-os:
name: Test on ${{ matrix.os }} using Node.js LTS
Expand All @@ -64,14 +64,35 @@ jobs:
node-version: 14.x
- run: yarn
- name: run tests
run: yarn travis
run: yarn cover
lint:
name: Run ESLint using Node.js LTS
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- uses: actions/[email protected]
with:
node-version: 14.x
- run: yarn
- run: yarn lint

release:
if:
# prettier-ignore
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
name: Release new version
needs: [test-node, test-os]
needs: [lint, test-node, test-os]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"main": "lib/index.js",
"scripts": {
"clean": "del-cli lib/ coverage/ example/*/build example/*/dist",
"prebuild": "npm run clean",
"build": "babel src/ --out-dir lib/",
"postbuild": "prettier lib/* --write",
"cover": "jest --coverage",
Expand All @@ -21,9 +22,7 @@
"build-and-update-license": "npm run build && npm run update-license",
"prepublishOnly": "npm run build",
"pretest": "npm run lint",
"test": "jest",
"pretravis": "npm run lint && npm run clean",
"travis": "npm run cover"
"test": "jest"
},
"repository": "SimenB/add-asset-html-webpack-plugin",
"keywords": [
Expand Down