From e27f8a9feeae3d00fd5e1c6a2735c8b35a836656 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Wed, 8 May 2024 16:39:08 -0400 Subject: [PATCH 1/2] Add codecov coverage uploading. --- .github/workflows/main.yml | 9 ++++++++- package.json | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10ad0795..0b0b0e0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,8 +13,15 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - run: npm ci && npm run build + - run: npm ci + - run: npm run build - run: npm test + - run: npm run test:gen-cov + - name: Upload coverage to CodeCov + uses: codecov/codecov-action@v4 + with: + directory: ./coverage + token: ${{ secrets.CODECOV_TOKEN }} integration_test_botToken: runs-on: ubuntu-latest diff --git a/package.json b/package.json index 8eb1e7a6..99f94031 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,9 @@ "scripts": { "lint": "eslint .", "local": "act public --eventpath .github/workflows/local/event.json --secret-file .github/workflows/local/.env --platform ubuntu-latest=node:20-buster", - "test:mocha": "nyc mocha --config .mocharc.json test/*-test.js", - "test": "npm run lint && npm run test:mocha", + "test:mocha": "mocha --config .mocharc.json test/*-test.js", + "test:gen-cov": "nyc --reporter=lcov npm run test:mocha", + "test": "npm run lint && nyc npm run test:mocha", "build": "npx @vercel/ncc build src/index.js --license licenses.txt" }, "repository": { From 0562f380266baedaba73ee6d9cb02fa66a6dc048 Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Wed, 8 May 2024 17:08:22 -0400 Subject: [PATCH 2/2] ignore coverage dir, add codecov badge, use 4.0.1 of codecov action --- .github/workflows/main.yml | 2 +- .gitignore | 1 + README.md | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0b0b0e0b..02f17140 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - run: npm test - run: npm run test:gen-cov - name: Upload coverage to CodeCov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v4.0.1 with: directory: ./coverage token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 18995261..f50d6db0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules .DS_Store .nyc_output dist +coverage diff --git a/README.md b/README.md index 4431768f..1bf94c62 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Slack Send GitHub Action +[![codecov](https://codecov.io/gh/slackapi/slack-github-action/graph/badge.svg?token=OZNX7FHN78)](https://codecov.io/gh/slackapi/slack-github-action) + Send data into Slack using this GitHub Action! ## Sending Variables