Skip to content

Don't fail if codecov if run from a branch #3172

Don't fail if codecov if run from a branch

Don't fail if codecov if run from a branch #3172

Workflow file for this run

name: Pull request
on:
pull_request:
branches:
- main
- master
- prod-beta
- prod-stable
- stage-beta
- stage-stable
env:
BRANCH: ${{ github.base_ref }}
jobs:
build:
name: koku-ui build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Lint
if: ${{ success() }}
run: npm run lint
- name: Test
if: ${{ success() }}
run: npm test -- --collect-coverage --max-workers=4
- name: Upload coverage report
if: ${{ success() }}
uses: codecov/codecov-action@v4.2.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
directory: coverage
plugin: pycoverage # Only run one plugin so that all do not run. There is no way to disable plugins entirely.