diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 875fb75e..656fa839 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,10 +73,16 @@ jobs: python3.8 -m pip install 'virtualenv<20.22' 'tox==4.5.1' tox-gh-actions tox --workdir .github/workflows/.tox --recreate + - name: Select the coverage file for upload + if: | + ( matrix.python-version == '3.6' || matrix.python-version == '3.11' ) && + ( !cancelled() && github.actor != 'nektos/act' ) + id: coverage + run: mv $( ls -t .github/workflows/.tox/*/log/.coverage | head -1 ) .coverage # The new reliable Codecov upload requires Codecov to query the GitHub API to check # the repo and the commit. The repo (or organisation) owner needs to login to - # codev, generated the CODECOV_TOKEN and save it as a secret in the ORG or the repo: + # codecov, generated the CODECOV_TOKEN and save it as a secret in the ORG or the repo: # https://docs.codecov.com/docs/adding-the-codecov-token # Links to get and set the token: @@ -91,19 +97,19 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} if: | + steps.coverage.outcome == 'success' && !env.CODECOV_TOKEN && !cancelled() && matrix.os == 'ubuntu-20.04' && github.actor != 'nektos/act' && ( github.event.pull_request.number || github.ref == 'refs/heads/master' ) uses: codecov/codecov-action@v3 with: - directory: .github/workflows/.tox/py38-covcombine-check/log env_vars: OS,PYTHON # Use fail_ci_if_error: false as explained the big comment above: # Not failing this job in this case is ok because the tox CI checks also contain # a diff-cover check which would fail on changed lines missing coverage. fail_ci_if_error: false - flags: unittest - name: py27-py38-combined + flags: ${{ matrix.python-version }} + name: Python${{ matrix.python-version }} verbose: true - name: Upload coverage reports to Codecov (used when secrets.CODECOV_TOKEN is set) @@ -111,21 +117,32 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} if: | - env.CODECOV_TOKEN && !cancelled() && github.actor != 'nektos/act' && - ( github.event.pull_request.number || github.ref == 'refs/heads/master' ) + steps.coverage.outcome == 'success' && matrix.os == 'ubuntu-20.04' && + env.CODECOV_TOKEN && !cancelled() && github.actor != 'nektos/act' run: > set -euxv; - mv .github/workflows/.tox/py38-covcombine-check/log/coverage.xml cov.xml; curl -O https://cli.codecov.io/latest/linux/codecov; sudo chmod +x codecov; + mv .github/workflows/.tox/py38-covcombine-check/log/coverage.xml cov.xml; ./codecov upload-process --report-type coverage --name "CLI Upload for ${{ env.PYTHON_VERSION }}" --git-service github --fail-on-error --file cov.xml --disable-search --flag python${{ env.PYTHON_VERSION }} continue-on-error: false # Fail the job if the upload with CODECOV_TOKEN fails - - - name: Upload coverage reports to Coveralls + - if: steps.coverage.outcome == 'success' + name: Upload coverage reports to Coveralls env: + COVERALLS_PARALLEL: true COVERALLS_FLAG_NAME: ${{ format('python{0}', steps.python.outputs.python-version ) }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pip install coveralls && coveralls --service=github && coveralls --finish + run: pip install coveralls && coveralls --service=github + + finish-coverage-upload: + if: github.actor != 'nektos/act' + needs: test + runs-on: ubuntu-latest + steps: + - name: Finish the coverage upload to Coveralls + uses: coverallsapp/github-action@v1 + with: + parallel-finished: true diff --git a/.vscode/ltex.dictionary.en-US.txt b/.vscode/ltex.dictionary.en-US.txt new file mode 100644 index 00000000..f8328637 --- /dev/null +++ b/.vscode/ltex.dictionary.en-US.txt @@ -0,0 +1,21 @@ +codecov +coverallsapp +cpio +euxv +ibft +ifrename +kname +lastboot +logbuf +MACPCI +nektos +organisation +pyfakefs +pyproject +PYTHONWARNINGS +rulefile +tname +tokenless +virtualenv +virutalenv +workdir