-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Lawndlwd/dev
feat: add github actions
- Loading branch information
Showing
6 changed files
with
2,256 additions
and
1,761 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,72 @@ | ||
name: CI/CD Pipeline | ||
|
||
on: | ||
pull_request: | ||
types: ['opened', 'edited', 'reopened', 'synchronize'] | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
typecheck: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 9.1.1 | ||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run build | ||
- run: pnpm install | ||
- run: pnpm typecheck | ||
test: | ||
runs-on: ubuntu-22.04 | ||
needs: [typecheck] | ||
strategy: | ||
matrix: | ||
node: ['20'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 9.1.1 | ||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run build | ||
- run: pnpm install | ||
- run: pnpm run coverage | ||
- name: Upload coverage report | ||
if: success() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage-report | ||
path: coverage/lcov-report/index.html | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
node: ['20'] | ||
runs-on: ubuntu-22.04 | ||
needs: [typecheck] | ||
steps: | ||
- uses: actions/checkout@v4 # v4.1.4 | ||
- uses: pnpm/[email protected] | ||
with: | ||
version: 9.1.1 | ||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: pnpm install | ||
- run: pnpm run build |
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,43 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- uses: pnpm/[email protected] | ||
with: | ||
version: 9.1.1 | ||
- name: Use Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20.x | ||
cache: 'pnpm' | ||
- run: pnpm install | ||
- run: pnpm run build | ||
|
||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Publish to npm | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_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
Oops, something went wrong.