File tree Expand file tree Collapse file tree 2 files changed +95
-0
lines changed
Expand file tree Collapse file tree 2 files changed +95
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build distribution
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ test :
9+ uses : ./.github/workflows/test.yml
10+ deploy :
11+ needs : test
12+ name : Deploy to PyPI
13+ permissions :
14+ id-token : write
15+ runs-on : ubuntu-latest
16+ steps :
17+ - name : Checkout source
18+ uses : actions/checkout@v4
19+
20+ - name : Set up Python 3.11
21+ uses : actions/setup-python@v5
22+ with :
23+ python-version : 3.11
24+ cache : " pip" # caching pip dependencies
25+ - name : Install build dependencies
26+ run : python -m pip install build twine
27+
28+ - name : Build distributions
29+ run : python -m build
30+
31+ - name : Publish package to PyPI
32+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 1+ name : PyTest
2+ on :
3+ workflow_call :
4+ workflow_dispatch :
5+ push :
6+ branches :
7+ - main
8+ pull_request :
9+ paths :
10+ - " .github/workflows/test.yml"
11+ - " src/**"
12+ - " tests/**"
13+ - " pyproject.toml"
14+ - " requirements.txt"
15+
16+ jobs :
17+ test-against-python-matrix :
18+ # Only test all the supported versions when a pull request is made or the workflow is called
19+ if : ${{github.event_name == 'workflow_call'}} || ${{github.event_name == 'pull_request'}}
20+ runs-on : ubuntu-latest
21+ strategy :
22+ matrix :
23+ python-version : ["3.10", "3.11", "3.12", "3.13"]
24+ fail-fast : true
25+ steps :
26+ - uses : actions/checkout@v4
27+ - uses : actions/setup-python@v5
28+ with :
29+ python-version : ${{ matrix.python-version }}
30+ cache : " pip" # caching pip dependencies
31+ - name : Install requirements
32+ run : |
33+ python -m pip install -e .[dev]
34+ - name : Run tests
35+ run : |
36+ python -m pytest
37+
38+ test-against-latest-os :
39+ # Always run against the latest version on both Windows, Linux, MacOS
40+ if : github.event.pull_request.user.login != 'dependabot[bot]'
41+ strategy :
42+ matrix :
43+ os : [windows-latest, macos-latest]
44+ fail-fast : true
45+ runs-on : ${{ matrix.os }}
46+ steps :
47+ - uses : actions/checkout@v4
48+ - uses : actions/setup-python@v5
49+ with :
50+ python-version : " 3.12"
51+ cache : " pip" # caching pip dependencies
52+ - name : Install requirements
53+ run : |
54+ python -m pip install -e .[dev]
55+ - name : Run tests
56+ run : |
57+ python -m pytest
58+ - name : coverage
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : code-coverage-report-${{ matrix.os }}
62+ path : .coverage
63+ overwrite : true
You can’t perform that action at this time.
0 commit comments