Skip to content

Commit

Permalink
chore: Upload coverage report using GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
manferlo81 committed Nov 12, 2024
1 parent 9960a1a commit 4872fa1
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
30 changes: 15 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codecov: codecov/codecov@4.1.0
# orbs:
# codecov: codecov/codecov@4.1.0

executors:
executor_node_18:
Expand Down Expand Up @@ -74,12 +74,12 @@ jobs:
- command_ci:
cache_key: v1-node-20-deps-foreach-prop

job_upload_coverage:
executor: executor_node_18
steps:
- command_restore_workspace
- codecov/upload:
file: coverage/*.json
# job_upload_coverage:
# executor: executor_node_18
# steps:
# - command_restore_workspace
# - codecov/upload:
# file: coverage/*.json

job_publish_to_npm:
executor: executor_node_18
Expand All @@ -104,13 +104,13 @@ workflows:
branches:
only: /.*/

- job_upload_coverage:
requires:
- job_node_18_ci
- job_node_20_ci
filters:
branches:
only: /main/
# - job_upload_coverage:
# requires:
# - job_node_18_ci
# - job_node_20_ci
# filters:
# branches:
# only: /main/

- job_publish_to_npm:
context: npm
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,29 @@ jobs:
uses: ./.github/workflows/lint-test-build.yml

job_upload_coverage:
name: Upload Coverage
name: Upload Coverage Report to Codecov

runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_type == 'branch'
needs: job_lint_test_build

steps:
- run: echo "not implemented yet..."
- name: Checkout, Setup Node.js v${{ env.DEFAULT_NODE_VERSION }} and Install dependencies
uses: manferlo81/action-checkout-node-install@v0
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

- name: Collect Coverage
run: npm test
env:
CI: true
COVERAGE: CI

- name: Upload Coverage Report
uses: codecov/codecov-action@v4
with:
directory: coverage
token: ${{ secrets.CODECOV_TOKEN }}

job_create_release:
name: Create GitHub Release
Expand All @@ -41,7 +56,7 @@ jobs:

steps:
- name: Checkout, Setup Node.js v${{ env.DEFAULT_NODE_VERSION }} and Install dependencies
uses: manferlo81/action-checkout-node-install@initial
uses: manferlo81/action-checkout-node-install@v0
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
- name: Build
run: npm test
env:
COVERAGE: 'SKIP'
COVERAGE: SKIP

0 comments on commit 4872fa1

Please sign in to comment.