-
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.
Adds more CI validations, introduces semantic release (#74)
- Loading branch information
1 parent
e43fd60
commit 1be7e3b
Showing
7 changed files
with
175 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Commit Lint | ||
|
||
on: | ||
- pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
commit-lint: | ||
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 | ||
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: Validate PR commits with commitlint | ||
id: commitlint | ||
continue-on-error: true | ||
run: | | ||
output=$(npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} 2>&1) || true | ||
echo "::set-output name=results::$output" | ||
- name: Create comment | ||
if: steps.commitlint.outputs.results | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
${{ steps.commitlint.outputs.results }} | ||
- 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 |
---|---|---|
@@ -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 | ||
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 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 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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