Skip to content

Commit

Permalink
chore: Upload coverage using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
manferlo81 committed Nov 11, 2024
1 parent 91f413b commit a8c8165
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
34 changes: 17 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codecov: codecov/[email protected]
# orbs:
# codecov: codecov/[email protected]

executors:
executor_node_18:
Expand Down Expand Up @@ -82,12 +82,12 @@ jobs:
cache_key: v1-node-20-deps-gen-unit
- command_ci

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 @@ -112,15 +112,15 @@ workflows:
branches:
only: /.*/

- job_upload_coverage:
requires:
- job_node_18_ci
- job_node_20_ci
filters:
branches:
only: /.*/
tags:
ignore: /.*/
# - job_upload_coverage:
# requires:
# - job_node_18_ci
# - job_node_20_ci
# filters:
# branches:
# only: /.*/
# tags:
# ignore: /.*/

- job_publish_to_npm:
context: npm
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,37 @@ on:
branches:
- main

env:
DEFAULT_NODE_VERSION: 20.x

jobs:
job_lint_test_build:
name: Lint, Test and Build
uses: './.github/workflows/lint-test-build.yml'

job_upload_coverage:
name: Upload Coverage
name: Upload Coverage 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: Test
run: npm test
env:
CI: true

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

job_create_release:
name: Create GitHub Release
Expand All @@ -37,12 +54,10 @@ jobs:
contents: write

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

- name: Build
run: npm run build
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ name: Lint, Test and Build
on:
workflow_call:

env:
DEFAULT_NODE_VERSION: 20.x

jobs:
job_lint:
name: Lint

runs-on: ubuntu-latest

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

- name: Lint
run: npm run lint
Expand Down

0 comments on commit a8c8165

Please sign in to comment.