ci: fix coverage upload error #179
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: ci | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.9, "3.10", 3.11, 3.12, 3.13, 3.14] | |
| steps: | |
| - name: Dump GitHub context | |
| env: | |
| GITHUB_CONTEXT: ${{ toJson(github) }} | |
| run: echo "$GITHUB_CONTEXT" | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v6 | |
| - uses: astral-sh/ruff-action@v3 | |
| - name: Setup PDM | |
| uses: pdm-project/setup-pdm@v4 | |
| with: | |
| cache: true | |
| python-version: ${{ matrix.python-version }} | |
| allow-python-prereleases: true | |
| - name: Config PDM | |
| run: pdm config --global venv.with_pip true | |
| - name: Prepare tools | |
| run: | | |
| python -m pip install --upgrade pip poetry pipx | |
| poetry config virtualenvs.create false | |
| poetry self add poetry-plugin-version | |
| poetry self add poetry-dynamic-versioning | |
| git config --global user.email "[email protected]" | |
| git config --global user.name "Waket Zheng" | |
| python -m pipx install -e . | |
| python -m pipx ensurepath | |
| python -c 'from pathlib import Path;p=Path.home()/".local/bin";p.exists() or p.mkdir(parents=True)' | |
| which pipx | |
| which fast | |
| ln -s `which fast` $HOME/.local/bin/fast | |
| - name: Install requirements/Check code style and Type Hint | |
| run: make check | |
| - name: Test with pytest | |
| run: | | |
| pdm run coverage run -m pytest | |
| pdm run python -c "import os;from pathlib import Path;pp=list(Path().glob('.coverage.*'));pp and os.system('pdm run coverage combine .coverage*')" | |
| - name: Upload Coverage | |
| run: | | |
| pdm run uv pip install "coveralls @ git+https://github.com/waketzheng/coveralls-python" | |
| pdm run coveralls --service=github | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| coveralls: | |
| name: Indicate completion to coveralls.io | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Finished | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| parallel-finished: true |