Skip to content

Commit

Permalink
fix: commitlint, move postinstall to prepare, husky (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno authored Mar 24, 2024
1 parent 2307fe4 commit 166ebc1
Show file tree
Hide file tree
Showing 6 changed files with 1,806 additions and 252 deletions.
108 changes: 56 additions & 52 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: |
npm ci --omit=optional
npm install --no-save warframe-worldstate-parser@^3.x warframe-worldstate-data@^2.x
- uses: actions/cache/save@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- run: |
npm ci --omit=optional
npm install --no-save warframe-worldstate-parser@^3.x warframe-worldstate-data@^2.x
- uses: actions/cache/save@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
lint:
needs: install
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- name: Run linters
run: npm run lint
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- name: Run linters
run: npm run lint
- name: Run commitlint
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
test:
name: Test
runs-on: ubuntu-latest
Expand All @@ -48,36 +52,36 @@ jobs:
matrix:
node-version: ['lts/*', '20', '18']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- run: npm test
env:
CI: true
parallel: true
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- run: npm test
env:
CI: true
parallel: true
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: [lint, install]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- run: npm test
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- uses: actions/cache/restore@v4
with:
path: |
./node_modules/**/*
key: node-ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
- run: npm test
env:
CI: true
- name: Coveralls
uses: coverallsapp/github-action@master
68 changes: 35 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
name: Release
on:
push:
branches:
- master
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Verify
run: |
npm ci --omit=optional
npm install --no-save warframe-worldstate-parser@^3.x warframe-worldstate-data@^2.x
npm run lint
npm test
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
branches: |
['master']
name: Release
on:
push:
branches:
- master
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Verify
run: |
npm ci --omit=optional
npm install --no-save warframe-worldstate-parser@^3.x warframe-worldstate-data@^2.x
npm run lint
npx commitlint --from=HEAD~1
npm test
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
with:
branches: |
['master']
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
Loading

0 comments on commit 166ebc1

Please sign in to comment.