From 4adca9e01edae2b419fe1e1c9c5a747b430995f9 Mon Sep 17 00:00:00 2001 From: Chris Kehayias Date: Sat, 21 Feb 2026 07:26:17 -0500 Subject: [PATCH] ci: add GitHub Actions test workflow with Codecov coverage - Add .github/workflows/test.yml running tests + v8 coverage on push to main and PRs - Upload coverage to Codecov via codecov-action v5 - Add Tests and Codecov badges to README.md Co-Authored-By: Claude Opus 4.6 --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2c4e1c2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Tests + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + + - name: Run tests with coverage + run: npx vitest run --coverage + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/coverage-final.json + fail_ci_if_error: false diff --git a/README.md b/README.md index a1fa81d..c364808 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # MPNext +[![Tests](https://github.com/MinistryPlatform-Community/MPNext/actions/workflows/test.yml/badge.svg)](https://github.com/MinistryPlatform-Community/MPNext/actions/workflows/test.yml) +[![codecov](https://codecov.io/gh/MinistryPlatform-Community/MPNext/graph/badge.svg)](https://codecov.io/gh/MinistryPlatform-Community/MPNext) + A modern Next.js application integrated with Ministry Platform authentication and REST API, built with TypeScript, Next.js 16, React 19, and Better Auth. ## Table of Contents