Skip to content

Commit

Permalink
ci: update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
PhotonQuantum committed Jun 4, 2024
1 parent ce357c6 commit 4f47cbf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build_n_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
name: Setup PDM and Python 3.10
- uses: pdm-project/setup-pdm@v4
name: Setup PDM and Python 3.12
with:
python-version: "3.10"
python-version: "3.12"
cache: true
version: 2.7.0
version: 2.15.4

- name: Install dependencies
run: pdm sync -G tests -G ocr
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/pysjtu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,31 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python: [ "3.8", "3.9", "3.10", "3.11" ]
python: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
- uses: pdm-project/setup-pdm@v4
name: Setup PDM and Python ${{ matrix.python }}
with:
python-version: ${{ matrix.python }}
cache: true
version: 2.7.0
version: 2.15.4

- name: Install dependencies
if: ${{ matrix.python != '3.11' }}
run: pdm sync -G tests -G ocr

- name: Install dependencies
if: ${{ matrix.python == '3.11' }}
run: pdm sync -G tests

- name: Test if no syntax error
run: pdm run flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics

- name: Test with pytest
run: pdm run pytest --cov-report xml --cov=pysjtu

- name: Upload coverage
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.8' && github.repository == 'PhotonQuantum/pysjtu'
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' && github.repository == 'PhotonQuantum/pysjtu'
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_COVERAGE_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ dev = [
]

[build-system]
requires = ["pdm-pep517>=1.0"]
build-backend = "pdm.pep517.api"
requires = ["pdm-backend"]
build-backend = "pdm.backend"

0 comments on commit 4f47cbf

Please sign in to comment.