-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add codecov flags and run test on different os.
- Loading branch information
Showing
2 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,49 +2,48 @@ name: Test | |
|
||
on: | ||
push: | ||
branches: [master, dev, fix_ci] | ||
branches: [master, dev] | ||
tags-ignore: | ||
- "**" | ||
- "*.*.*" | ||
pull_request: | ||
branches: [master] | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: test with python${{ matrix.python-version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
python-version: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Lint code | ||
run: | | ||
flake8 | ||
- name: Type check | ||
run: | | ||
mypy | ||
- name: Format check | ||
run: | | ||
black --check . | ||
- name: Install tox | ||
run: python -m pip install tox-gh>=1.2 | ||
|
||
- name: Run pytest | ||
run: | | ||
coverage run -m pytest | ||
coverage xml | ||
- name: Run test | ||
run: tox | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
flags: ${{ format('python{0} ({1})', matrix.python-version, matrix.os) }} |
This file contains 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