From 11603e385f2db8c7bdc64190ece17e9d2b7b9366 Mon Sep 17 00:00:00 2001 From: Mallik Cheripally Date: Fri, 9 Aug 2024 17:35:47 +0530 Subject: [PATCH] feat: add CI workflow with Node.js and Codecov integration Introduce a CI pipeline that triggers on pushes and pull requests to the main branch and feature branches. This workflow includes building the project, running tests with coverage, and uploading coverage reports to Codecov. --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) 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..56af709 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + branches: + - main + - 'feature/*' + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20] # Test against Node.js 20 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - run: yarn install + - run: yarn build + + - name: Run tests with coverage + run: yarn test --coverage + env: + CI: true + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + files: ./coverage/lcov.info + flags: unittests + name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }}