-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): adds more CI validations, introduces semantic release (#74)
- Adds eslint check on before commit and in CI - Adds commit lint in CI for main - Uses semantic release
- Loading branch information
1 parent
7f11ac8
commit 2683bf5
Showing
24 changed files
with
12,072 additions
and
4,792 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Commit Lint | ||
|
||
on: | ||
- workflow_call | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
duplicate-check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@v5 | ||
with: | ||
concurrent_skipping: 'never' | ||
skip_after_successful_duplicate: 'true' | ||
|
||
commit-lint: | ||
if: needs.duplicate-check.outputs.should_skip != 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Validate PR commits with commitlint | ||
uses: wagoid/commitlint-github-action@v6 |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: Commit Lint Feature Check | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
commit-lint: | ||
name: Main | ||
uses: ./.github/workflows/commit-lint-reusable.yml | ||
secrets: inherit |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Lint | ||
|
||
on: | ||
- pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
ref: main | ||
|
||
- name: Setup Node.js | ||
id: setup_node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.0.0 | ||
|
||
- name: Restore node_modules cache | ||
id: deps-cache | ||
uses: martijnhols/actions-cache/restore@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
if: steps.deps-cache.outputs.cache-hit != 'true' | ||
run: npm install | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
- name: Cache node modules | ||
if: steps.deps-cache.outputs.cache-hit != 'true' | ||
uses: martijnhols/actions-cache/save@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release from Master on Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
ref: main | ||
|
||
- name: Fetch other branches for commitlint | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Setup Node.js | ||
if: steps.changes.outputs.ts == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.0.0 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Validate PR commits with commitlint | ||
uses: wagoid/commitlint-github-action@v6 | ||
|
||
- name: Lint | ||
run: npm run lint | ||
|
||
- name: Test | ||
run: npm run test:cov | ||
|
||
- name: Release npm package | ||
uses: cycjimmy/semantic-release-action@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Upload Test Coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./ts/coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Test | ||
|
||
on: | ||
- pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
ref: main | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.0.0 | ||
cache: npm | ||
|
||
- name: Restore node_modules cache | ||
id: deps-cache | ||
uses: martijnhols/actions-cache/restore@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }} | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Test | ||
run: npm run test:cov | ||
|
||
- name: Upload Test Coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: ./ts/coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Cache node modules | ||
if: steps.deps-cache.outputs.cache-hit != 'true' | ||
uses: martijnhols/actions-cache/save@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }} |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ umd/ | |
|
||
# Coverage directory | ||
.nyc_output/ | ||
coverage | ||
|
||
# Log files | ||
yarn-error.log | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no -- commitlint --edit $1 |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"tarballDir": "package" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": "package/*.tgz" | ||
} | ||
], | ||
"@semantic-release/git" | ||
], | ||
"branches": [ | ||
{ | ||
"name": "main" | ||
} | ||
], | ||
"preset": "conventionalcommits" | ||
} |
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 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ["@commitlint/config-conventional"] }; |
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
Oops, something went wrong.