Skip to content

Commit

Permalink
Update ci (#2)
Browse files Browse the repository at this point in the history
ci(pyprof): remove coveralls.io; use poetry; add more python versions

---------

Co-authored-by: Zeyan Li 李则言 <lizeyan.42@bytedance.com>
  • Loading branch information
lizeyan and Zeyan Li 李则言 committed Mar 7, 2024
1 parent acbf712 commit f2a50aa
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 28 deletions.
55 changes: 27 additions & 28 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,39 @@

name: Python package

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.10, 3.11, 3.12]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
poetry-version: [ "1.8.2" ]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip # This path is specific to Ubuntu
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
- name: Install dependencies
run: |
pip install -U poetry
poetry install
- name: Test with pytest
run: |
PYTHONPATH=$(realpath .) coverage run -m pytest tests
- name: Genrate Coverage Report
run: |
PYTHONPATH=$(realpath .) coverage report
- name: Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
coveralls
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Poetry Image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install --no-root
- name: Test with pytest
run: |
PYTHONPATH=$(realpath .) coverage run -m pytest tests
- name: Generate Coverage Report
run: |
PYTHONPATH=$(realpath .) coverage report
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .idea/GitCommitMessageStorage.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ mypy = "^1.8.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.coverage.run]
relative_files = true

0 comments on commit f2a50aa

Please sign in to comment.