Skip to content

Commit

Permalink
chore(ci): adjust codecov settings and update step-generation workflow (
Browse files Browse the repository at this point in the history
#17424)

- Most js projects were not uploading to codecov before the change in
#17406 to produce lcov output.
- Now that they are, we don't want ❌ everywhere so let us adjust the patch
threshold and catch up the ignore list.
- Tackle any specific areas of coverage deficit strategically.
- In addition convert `.github/workflows/step-generation-test.yaml` to the
pattern of PD like in #17406
  • Loading branch information
y3rsh authored Feb 6, 2025
1 parent ff9f365 commit 73b70f4
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 48 deletions.
66 changes: 47 additions & 19 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,55 @@
version: 2.0

coverage:
status:
project:
default:
target: auto
threshold: '10'
patch:
default:
target: auto
threshold: 0

comment:
layout: 'reach, diff, flags, files'

ignore:
- '**/node_modules'
- 'webpack-config'
- 'hardware-testing'
- '**/*.md'
- '**/*.yaml'
- 'webpack-config/**'
- 'hardware-testing/**'
- 'abr-testing/**'
- 'test-data-generation/**'
- 'performance-metrics/**'
- 'package-testing/**'
- 'opentrons-ai-server/**'
- 'opentrons-ai-client/**'
- 'g-code-testing/**'
- 'api-client/**'
- 'analyses-snapshot-testing/**'
- '.storybook/**'
- 'react-api-client/**'
- 'scripts/**'
- '.github/**'
- '**/build/**'
- '**/dist/**'
- '**/node_modules/**'
- '**/{test,tests,__tests__,__mocks__,mocks}/**'
- '**/*.{md,yaml,yml,json,rst}'
- '**/Makefile'
- '**/*.in'
- '**/*.json'
- '**/*.config.js'
- '**/*.{in,ini,lock,toml,cfg}'
- '**/setup.py'
- '**/requirements.txt'
- '**/.flake8'
- '**/.coveragerc'
- '**/.prettierrc.js'
- '**/.eslintrc.js'
- '**/Pipfile'
- '**/Dockerfile*'
- '**/*.{config.js,config.ts}'
- '**/*.mk'
- '**/*.stories.tsx'

comment:
# add flags to `layout` configuration to show up in the PR comment
layout: 'reach, diff, flags, files'
- '**/*.{mjs,css,cjs,mts}'

flag_management:
default_rules:
carryforward: true

coverage:
status:
project:
default:
target: auto
threshold: 10
38 changes: 12 additions & 26 deletions .github/workflows/step-generation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ on:
- 'shared-data/**'
- 'package.json'
- '.github/workflows/step-generation-test.yaml'
- '.github/actions/js/setup/action.yml'
- '.github/actions/git/resolve-tag/action.yml'
- '.github/actions/environment/complex-variables/action.yml'
push:
paths:
- 'step-generation/**'
- 'shared-data/**'
- 'package.json'
- '.github/workflows/step-generation-test.yaml'
- '.github/actions/js/setup/action.yml'
- '.github/actions/git/resolve-tag/action.yml'
- '.github/actions/environment/complex-variables/action.yml'
branches:
- '*'

Expand All @@ -33,35 +39,15 @@ jobs:
js-unit-test:
name: 'step generation unit tests'
runs-on: 'ubuntu-24.04'
timeout-minutes: 30
timeout-minutes: 20
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-node@v4'
with:
node-version: '22.11.0'
- name: 'install udev for usb-detection'
run: |
# WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update && sudo apt-get install libudev-dev
- name: 'cache yarn cache'
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.yarn-cache
${{ github.workspace }}/.npm-cache
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
- name: 'setup-js'
run: |
npm config set cache ./.npm-cache
yarn config set cache-folder ./.yarn-cache
make setup-js
- name: 'Checkout Repository'
uses: actions/checkout@v4
- uses: ./.github/actions/js/setup
- name: 'run step generation unit tests'
run: make -C step-generation test-cov
- name: 'Upload coverage report'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
flags: step-generation
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Opentrons Platform
Copyright 2015-2020 Opentrons Labworks, Inc.
Copyright 2015-2025 Opentrons Labworks, Inc.

The source code in this repository is licensed under the Apache License,
Version 2.0 (the "License"); you may not use this code except in
Expand Down
4 changes: 2 additions & 2 deletions step-generation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# using bash instead of /bin/bash in SHELL prevents macOS optimizing away our PATH update
SHELL := bash

# These variables can be overriden when make is invoked to customize the
# These variables can be overridden when make is invoked to customize the
# behavior of jest
tests ?=
cov_opts ?= --coverage=true
cov_opts ?= --coverage --pool=threads
test_opts ?=

.PHONY: test
Expand Down

0 comments on commit 73b70f4

Please sign in to comment.