Skip to content

Commit

Permalink
ci(update CI configurations):
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyan Li 李则言 committed Mar 7, 2024
1 parent acbf712 commit 99fd49c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 28 deletions.
61 changes: 33 additions & 28 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,45 @@

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: 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: |
poetry config virtualenvs.create false
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
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.

0 comments on commit 99fd49c

Please sign in to comment.