From 8f44fca32a7329a69191bfa277f854233b1df592 Mon Sep 17 00:00:00 2001 From: PeterYinusa Date: Tue, 24 Mar 2026 19:33:05 +0000 Subject: [PATCH] chore: add PR build and test workflow --- .github/workflows/ci.yml | 20 ++++++++++++++++++++ .github/workflows/publish-docs.yml | 11 ++++++----- .github/workflows/publish-package-npm.yml | 9 +++++++-- 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d9f7217 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,20 @@ +name: CI + +on: + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Install dependencies + run: yarn + - name: Build + run: yarn build + - name: Test + run: yarn test \ No newline at end of file diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 0e81863..650c849 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -22,11 +22,12 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20.x' - registry-url: 'https://registry.npmjs.org' - scope: '@assert-equals' - - run: yarn && yarn docs - - name: 'Upload Pages artifact' - uses: 'actions/upload-pages-artifact@v3' + - name: Install dependencies + run: yarn + - name: Generate documentation + run: yarn docs + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 with: path: 'docs/' diff --git a/.github/workflows/publish-package-npm.yml b/.github/workflows/publish-package-npm.yml index 7b0fd99..b04f96f 100644 --- a/.github/workflows/publish-package-npm.yml +++ b/.github/workflows/publish-package-npm.yml @@ -1,4 +1,5 @@ name: Publish package to npm + on: push: tags: @@ -18,7 +19,11 @@ jobs: node-version: '20.x' registry-url: 'https://registry.npmjs.org' scope: '@assert-equals' - - run: yarn && yarn build - - run: yarn publish + - name: Install dependencies + run: yarn + - name: Build + run: yarn build + - name: Publish to npm + run: yarn publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}