Skip to content

chore: Upload coverage report using GHA #4

chore: Upload coverage report using GHA

chore: Upload coverage report using GHA #4

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
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 Report to Codecov
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_type == 'branch'
needs: job_lint_test_build
steps:
- 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
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: job_lint_test_build
permissions:
contents: write
steps:
- 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: Build
run: npm run build
- name: Create Tarball
run: npm pack
- name: Create Release
uses: manferlo81/action-auto-release@v0
with:
files: foreach-prop-*.tgz
job_publish_to_npm:
name: Publish Package to npm Registry
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: job_lint_test_build
steps:
- run: echo "not implemented yet..."