diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0fbbbba5..5a4731871 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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' @@ -88,7 +90,7 @@ 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' @@ -96,14 +98,29 @@ jobs: || 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 - @@ -111,6 +128,9 @@ jobs: 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 @@ -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 @@ -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 @@ -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' diff --git a/.gitignore b/.gitignore index 75feaf849..70439ec7e 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ !.readthedocs.yaml !.secrets.baseline !alembic.ini +!codecov.yml !Dockerfile !MANIFEST.in !Makefile diff --git a/CHANGELOG.md b/CHANGELOG.md index 789a739fa..a4624c68b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..b8f83e56f --- /dev/null +++ b/codecov.yml @@ -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