From a9a0bd40e8dc351a7a20fdfa3b1e4a6923ea7cc7 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 09:21:34 +0100 Subject: [PATCH 1/3] ci(pull request): init workflow --- .github/actions/build/action.yml | 12 +++++++++ .github/actions/lint/action.yml | 12 +++++++++ .github/actions/setup/action.yml | 18 +++++++++++++ .github/actions/test/action.yml | 12 +++++++++ .github/workflows/pull-request.yml | 43 ++++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 .github/actions/build/action.yml create mode 100644 .github/actions/lint/action.yml create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/actions/test/action.yml create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..fc348c5 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,12 @@ +name: Build +description: Build the package + +runs: + using: composite + steps: + - name: Setup + uses: ./.github/actions/setup + + - name: Build the package + shell: bash + run: pnpm build diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml new file mode 100644 index 0000000..1148ab0 --- /dev/null +++ b/.github/actions/lint/action.yml @@ -0,0 +1,12 @@ +name: Lint +description: Run linting for the package + +runs: + using: composite + steps: + - name: Setup + uses: ./.github/actions/setup + + - name: Run linting + shell: bash + run: pnpm lint diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..3fbf14a --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,18 @@ +name: Setup +description: Setup Node.js and pnpm, and install dependencies + +runs: + using: composite + steps: + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install dependencies + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml new file mode 100644 index 0000000..38ba4d7 --- /dev/null +++ b/.github/actions/test/action.yml @@ -0,0 +1,12 @@ +name: Test +description: Run tests for the package + +runs: + using: composite + steps: + - name: Setup + uses: ./.github/actions/setup + + - name: Run tests + shell: bash + run: pnpm test diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..e809dfe --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,43 @@ +name: Pull Request + +on: + pull_request: + branches: + - main + +jobs: + # Quality Gate Stage + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Lint + uses: ./.github/actions/lint + + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Test + uses: ./.github/actions/test + + # Build Stage + build: + name: Build + runs-on: ubuntu-latest + needs: [lint, test] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build + uses: ./.github/actions/build From 4c1fd903f17cb5bc1985ee279f2cc76f96dd9487 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 09:36:20 +0100 Subject: [PATCH 2/3] ci(analyse): also execute analyse step on commit to main branch --- .github/workflows/{pull-request.yml => analyse.yml} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename .github/workflows/{pull-request.yml => analyse.yml} (91%) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/analyse.yml similarity index 91% rename from .github/workflows/pull-request.yml rename to .github/workflows/analyse.yml index e809dfe..85aef8f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/analyse.yml @@ -1,6 +1,9 @@ -name: Pull Request +name: Analyse package health on: + push: + branches: + - main pull_request: branches: - main From 2e89f55fb773686d0cc1cf9129980850f7981631 Mon Sep 17 00:00:00 2001 From: Berrie Nachtweh Date: Thu, 15 Jan 2026 09:43:23 +0100 Subject: [PATCH 3/3] ci(test): use coverage task and add concurrency --- .github/actions/test/action.yml | 2 +- .github/workflows/analyse.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 38ba4d7..05a84a0 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -9,4 +9,4 @@ runs: - name: Run tests shell: bash - run: pnpm test + run: pnpm test:coverage diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 85aef8f..650bc3b 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: # Quality Gate Stage lint: