From 6c887db7d6f8d4e6ae0c410a0250d21a6121198b Mon Sep 17 00:00:00 2001 From: Jirka B Date: Sat, 26 Jul 2025 00:37:04 +0200 Subject: [PATCH] ci: simplify internal testing workflow --- .github/actions/unittesting/action.yml | 65 -------------------------- .github/workflows/ci-testing.yml | 16 ++++--- 2 files changed, 9 insertions(+), 72 deletions(-) delete mode 100644 .github/actions/unittesting/action.yml diff --git a/.github/actions/unittesting/action.yml b/.github/actions/unittesting/action.yml deleted file mode 100644 index 26c6708a..00000000 --- a/.github/actions/unittesting/action.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Unittest and coverage -description: pull data samples -> unittests - -inputs: - python-version: - description: Python version - required: true - pkg-name: - description: package name for coverage collections - required: true - requires: - description: define oldest or latest - required: false - default: "" - dirs: - description: Testing folders per domains, space separated string - required: false - default: "." - pytest-args: - description: Additional pytest arguments such as `--timeout=120` - required: false - default: "" - shell-type: - description: Define Shell type - required: false - default: "bash" - -runs: - using: "composite" - steps: - - name: Python 🐍 details - run: | - python --version - pip --version - pip list - shell: ${{ inputs.shell-type }} - - - name: Determine artifact file name - run: echo "artifact=test-results-${{ runner.os }}-py${{ inputs.python-version }}-${{ inputs.requires }}" >> $GITHUB_OUTPUT - id: location - shell: bash - - - name: Unittests - working-directory: ./tests - run: | - python -m pytest ${{ inputs.dirs }} \ - --cov=${{ inputs.pkg-name }} --durations=50 ${{ inputs.test-timeout }} \ - --junitxml="${{ steps.location.outputs.artifact }}.xml" - shell: ${{ inputs.shell-type }} - - - name: Upload pytest results - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.location.outputs.artifact }} - path: "test/${{ steps.location.outputs.artifact }}.xml" - include-hidden-files: true - if: failure() - - - name: Statistics - if: success() - working-directory: ./tests - run: | - coverage xml - coverage report - shell: ${{ inputs.shell-type }} diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index cdc05fc3..f69033c7 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -57,13 +57,15 @@ jobs: - name: Print 🖨️ dependencies uses: ./.github/actions/pip-list - - name: Unittest and coverage - uses: ./.github/actions/unittesting - with: - python-version: ${{ matrix.python-version }} - dirs: "unittests" - pkg-name: "lightning_utilities" - pytest-args: "--timeout=120" + - name: Unittests + working-directory: ./tests + run: python -m pytest unittests --cov=lightning_utilities --durations=50 --timeout=120 + + - name: Statistics + working-directory: ./tests + run: | + coverage xml + coverage report - name: Upload coverage to Codecov uses: codecov/codecov-action@v5.4.3