Skip to content

Commit

Permalink
enabling codecov carryforward (#949)
Browse files Browse the repository at this point in the history
* enabling codecov carryforward

* adjusting validation step

* adding rsync install

* enabling carryforward flags on PR comments

* removing filelist in codecov PR comment
  • Loading branch information
wjcunningham7 authored Aug 2, 2022
1 parent a1a8770 commit 56454f8
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 9 deletions.
42 changes: 33 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ jobs:
dispatcher:
- 'covalent_dispatcher/**'
ui_backend:
- 'covalent_ui/**'
- 'covalent_ui/*.py'
ui_backend_tests:
- 'tests/covalent_ui_tests/**'
ui_frontend:
- 'covalent_ui/webapp/**'
- name: Set up Python
if: matrix.os == 'macos-latest'
Expand All @@ -88,29 +90,47 @@ jobs:
pip install --no-cache-dir -r ./requirements.txt
pip install --no-cache-dir -r ./tests/requirements.txt
- name: Install NPM and Yarn on Ubuntu
- name: Install rsync on Ubuntu
if: >
matrix.container == 'python:3.8-buster'
|| matrix.container == 'python:3.8-bullseye'
|| matrix.container == 'python:3.9-buster'
|| matrix.container == 'python:3.9-bullseye'
|| matrix.container == 'python:3.10-buster'
|| matrix.container == 'python:3.10-bullseye'
run: apt-get update && apt-get install -y rsync

- name: Install NPM and Yarn on Ubuntu
if: >
(github.event_name != 'pull_request'
|| steps.working-directory.outputs.ui_frontend == 'true')
&& (matrix.container == 'python:3.8-buster'
|| matrix.container == 'python:3.8-bullseye'
|| matrix.container == 'python:3.9-buster'
|| matrix.container == 'python:3.9-bullseye'
|| matrix.container == 'python:3.10-buster'
|| matrix.container == 'python:3.10-bullseye')
run: |
apt-get update && apt-get install -y curl rsync
apt-get install -y curl
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs
npm install -g yarn
- name: Install NPM and Yarn on CentOS
if: matrix.container.image == 'centos/python-38-centos7'
if: >
(github.event_name != 'pull_request'
|| steps.working-directory.outputs.ui_frontend == 'true')
&& matrix.container.image == 'centos/python-38-centos7'
run: |
yum remove -y npm nodejs
curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
yum install -y npm nodejs
npm install -g yarn
- name: Build webapp
if: >
github.event_name != 'pull_request'
|| steps.working-directory.outputs.ui_frontend == 'true'
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
Expand All @@ -121,9 +141,11 @@ jobs:
yarn build
- name: Build distribution
if: github.event_name != 'pull_request'
run: python setup.py sdist

- name: Validate distribution
if: github.event_name != 'pull_request'
run: |
VERSION="$(cat ./VERSION)"
cd dist
Expand Down Expand Up @@ -173,17 +195,19 @@ jobs:
- name: Run UI backend tests and measure coverage
id: ui_tests
if: >
github.event_name != 'pull_request'
|| steps.working-directory.outputs.ui_backend == 'true'
false
&& (github.event_name != 'pull_request'
|| steps.working-directory.outputs.ui_backend == 'true')
run: PYTHONPATH=$PWD/ pytest -vv --reruns=5 tests/covalent_ui_tests --cov=covalent_ui --cov-config=.coveragerc

- name: Generate UI backend coverage report
continue-on-error: true
if: >
github.event_name != 'pull_request'
false
&& (github.event_name != 'pull_request'
|| (steps.working-directory.outputs.ui_backend_tests == 'true'
&& steps.working-directory.outputs.ui_backend == 'true'
&& steps.ui_tests.outputs.exit_code == 0)
&& steps.ui_tests.outputs.exit_code == 0))
run: coverage xml -o ui_backend_coverage.xml

- name: Upload SDK report to Codecov
Expand Down Expand Up @@ -222,7 +246,7 @@ jobs:

- name: Upload UI backend report to Codecov
if: >
'false'
false
&& matrix.os == 'ubuntu-latest'
&& matrix.container == 'python:3.8-buster'
&& (github.event_name != 'pull_request'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
!.readthedocs.yaml
!.secrets.baseline
!alembic.ini
!codecov.yml
!Dockerfile
!MANIFEST.in
!Makefile
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `paths-filter` will only be run on PRs, i.e on workflow runs, the whole test suite will be run.
- Removed retry action from running on `pytest` steps since they instead use `pytest` retries.
- `codecov.yml` added to enable carry-forward flags
- UI front-end is only built for pull requests when the source changes
- Packaging is only validated on the `develop` branch

## [0.158.0] - 2022-07-29

Expand Down
33 changes: 33 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2021 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the GNU Affero General Public License 3.0 (the "License").
# A copy of the License may be obtained with this software package or at
#
# https://www.gnu.org/licenses/agpl-3.0.en.html
#
# Use of this file is prohibited except in compliance with the License. Any
# modifications or derivative works of this file must retain this copyright
# notice, and modified files must contain a notice indicating that they have
# been altered from the originals.
#
# Covalent is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
#
# Relief from the License may be granted by purchasing a commercial license.

flags:
SDK:
paths:
- covalent/**
carryforward: true
Dispatcher:
paths:
- covalent_dispatcher/**
carryforward: true

comment:
layout: "reach, diff, flags"
show_carryforward_flags: true

0 comments on commit 56454f8

Please sign in to comment.