From 80475c57b212869c5cbe794b9b6ea9da8fafb601 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Wed, 10 Apr 2024 09:45:57 +0100 Subject: [PATCH] [CI] Optimize runs (#6991) * only run backend if required * alwass upload coverage --- .github/workflows/qc_checks.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index 580eed7341..936dec2586 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -220,7 +220,8 @@ jobs: name: Tests - inventree-python runs-on: ubuntu-20.04 - needs: pre-commit + needs: [ 'pre-commit', 'paths-filter' ] + if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true' env: wrapper_name: inventree-python @@ -261,7 +262,8 @@ jobs: name: Tests - DB [SQLite] + Coverage runs-on: ubuntu-20.04 - needs: [ 'pre-commit' ] + needs: [ 'pre-commit', 'paths-filter' ] + if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true' continue-on-error: true # continue if a step fails so that coverage gets pushed env: @@ -298,6 +300,7 @@ jobs: parallel: true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 + if: always() with: token: ${{ secrets.CODECOV_TOKEN }} slug: inventree/InvenTree @@ -306,7 +309,8 @@ jobs: postgres: name: Tests - DB [PostgreSQL] runs-on: ubuntu-20.04 - needs: [ 'pre-commit' ] + needs: [ 'pre-commit', 'paths-filter' ] + if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true' env: INVENTREE_DB_ENGINE: django.db.backends.postgresql @@ -350,7 +354,8 @@ jobs: name: Tests - DB [MySQL] runs-on: ubuntu-20.04 - needs: [ 'pre-commit' ] + needs: [ 'pre-commit', 'paths-filter' ] + if: needs.paths-filter.outputs.server == 'true' || needs.paths-filter.outputs.force == 'true' env: # Database backend configuration @@ -435,6 +440,7 @@ jobs: git-branch: ${{ github.ref }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 + if: always() with: token: ${{ secrets.CODECOV_TOKEN }} slug: inventree/InvenTree @@ -539,6 +545,7 @@ jobs: parallel: true - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4.0.1 + if: always() with: token: ${{ secrets.CODECOV_TOKEN }} slug: inventree/InvenTree