Skip to content

Commit

Permalink
Add ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenpelgrims committed Apr 1, 2024
1 parent dcf2c59 commit 96e76a6
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .github/workflows/on-feature-branch-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
on:
push:
branches-ignore:
- master

jobs:
test-and-build:
name: Test and build
uses: ./.github/workflows/test-and-build.yml
18 changes: 18 additions & 0 deletions .github/workflows/on-master-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on:
push:
branches:
- master

jobs:
test-and-build:
name: Test and build
uses: ./.github/workflows/test-and-build.yml
publish:
name: Publish
needs: test-and-build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test and build

on:
workflow_call:

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm i -g pnpm && pnpm i
- name: Check types
run: pnpm check
- name: Run tests
run: pnpm test
- name: Build
run: pnpm build
- uses: actions/upload-artifact@v4
with:
path: |
.
!node_modules
!coverage
retention-days: 1
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"prepublish": "npm run build && npm run test",
"build": "tsup",
"check": "tsc --noEmit",
"test": "jest --collectCoverage",
Expand Down

0 comments on commit 96e76a6

Please sign in to comment.