From c1d531f10f5c5ad3642f8fe6b9af6c0083c25211 Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Wed, 14 Feb 2024 18:08:15 +0100 Subject: [PATCH] update main.yml Signed-off-by: Bernhard Kaindl --- .github/workflows/main.yml | 45 ++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0258f36..0f8b07e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,12 +6,14 @@ # podman system service -t 0 & # act --bind --container-daemon-socket $XDG_RUNTIME_DIR/podman/podman.sock -W .github/workflows/main.yml #-------------------------------------------------------------------------------------- -name: "GitHub CI" +name: "Pytest test suites" +# # The GitHub events that trigger this workflow: # Checks can be skipped by adding "skip-checks: true" to a commit message, # or requested by adding "request-checks: true" if disabled by default for pushes: # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks#skipping-and-requesting-checks-for-individual-commits +# on: [push, pull_request] # Docs: https://github.com/marketplace/actions/commit-status-updater#workflow-permissions @@ -21,9 +23,11 @@ permissions: pull-requests: write # creating a comment statuses: write # # updating commit status +# # Cancel a currently running workflow from the same PR, branch or tag # when a new workflow is triggered: # https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre +# concurrency: cancel-in-progress: true group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -59,12 +63,12 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: LizardByte/setup-python-action@master + with: + python-version: 2.7 + - name: Install dependencies run: | - #: Install Python 2.7 from Ubuntu 20.04 using apt-get install - sudo apt-get update && sudo apt-get install -y python2 - curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py - python2 get-pip.py if [ -f requirements.txt ]; then pip2 install -r requirements.txt; fi if [ -f requirements-dev.txt ]; then pip2 install -r requirements-dev.txt; fi pip2 install pylint==1.9.4 @@ -78,7 +82,6 @@ jobs: --cov tests/ --junitxml=.git/pytest27.xml --cov-report term-missing - --cov-report html:.git/coverage27.html --cov-report xml:.git/coverage27.xml - name: Upload coverage reports to Codecov for the Python 2.7 tests @@ -86,15 +89,10 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} if: env.CODECOV_TOKEN && !cancelled() && github.event.pull_request.number run: > - curl -Os https://cli.codecov.io/latest/linux/codecov && - sudo chmod +x codecov && - ./codecov do-upload --report-type test_results - --file .git/pytest27.xml - --token $CODECOV_TOKEN && - ./codecov do-upload --report-type coverage - --file .git/coverage27.xml - --flags python2.7 - --token $CODECOV_TOKEN + rm -rfv codecov;curl -O https://cli.codecov.io/latest/linux/codecov && + sudo chmod +x codecov && ./codecov upload-process --report-type coverage + --git-service github --fail-on-error --dir .git --file coverage27.xml + --flag python2.7 --name "Python 2.7 for main" continue-on-error: true @@ -111,7 +109,7 @@ jobs: flags: python2.7 env_vars: OS,PYTHON fail_ci_if_error: false - name: coverage27 + name: "Python 2.7 for main" verbose: true - name: Add Pytest 2.7 coverage comment (if write permission is available) @@ -184,15 +182,10 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} run: > - curl -Os https://cli.codecov.io/latest/linux/codecov && - sudo chmod +x codecov && - ./codecov do-upload --report-type test_results - --file .git/pytest.xml - --token $CODECOV_TOKEN && - ./codecov do-upload --report-type coverage - --file .git/coverage.xml - --flags ${{ format('python{0}', steps.python.outputs.python-version ) }} - --token $CODECOV_TOKEN + pip install codecov-cli && codecovcli upload-process --report-type coverage + --git-service github --fail-on-error --dir .git --file coverage.xml + --flag python${{ steps.python.outputs.python-version }} + --name "Python 3.x for main" continue-on-error: true @@ -211,7 +204,7 @@ jobs: fail_ci_if_error: false flags: > ${{ format('python{0}', steps.python.outputs.python-version ) }} - name: coverage + name: "Python 3.x for main" verbose: true