refactor: use pyproject.toml for environment build #113
Workflow file for this run
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Pytest | |
on: | |
push: | |
branches: ["main", "test"] | |
pull_request: | |
branches: ["main", "test"] | |
jobs: | |
lint: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Lint with flake8 and black | |
run: | | |
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
poetry run black --verbose --check . | |
coverage-perf: | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run tests and collect coverage, benchmark | |
run: poetry run pytest --cov --verbose -p no:warnings --memray --benchmark-json output.json | |
- name: Upload coverage reports to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${{ secrets.CODECOV_TOKEN }} | |
- name: Continuous Benchmark | |
uses: benchmark-action/[email protected] | |
with: | |
name: cyeva Benchmark | |
tool: "pytest" | |
output-file-path: output.json | |
github-token: ${{ secrets.OPS_ACTIONS_CI_TOKEN }} | |
gh-repository: "github.com/caiyunapp/cyeva" | |
auto-push: true | |
alert-threshold: "150%" | |
comment-on-alert: true | |
fail-on-alert: false | |
benchmark-data-dir-path: "performance/" | |
alert-comment-cc-users: "@clarmy" | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["macos-latest", "ubuntu-latest", "windows-latest"] | |
python-version: ["3.7", "3.8", "3.9", "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Test with pytest | |
run: poetry run pytest ./tests/functions ./tests/test_issues.py |