-
-
Notifications
You must be signed in to change notification settings - Fork 22
101 lines (90 loc) · 2.78 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
on:
pull_request:
types: [opened, synchronize]
branches: [master]
defaults:
run:
shell: bash
env:
PYTHONUTF8: "1"
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check git is working
run: |
git config --global user.email "[email protected]"
git config --global user.name "Testing Git"
git --version
git config --list
- name: Check mercurial is working
run: |
echo -e '[ui]\nusername = Testing Mercurial<[email protected]>' > ~/.hgrc
hg --version
- name: Install requirements
shell: bash
run: |
uv sync -p 3.12 --group dev
- name: Test
run: pytest --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: test-reports/coverage.xml
flags: python-${{ matrix.python-version }}
verbose: true # optional (default = false)
env_vars: OS,PYTHON
# Upload to Test PyPI.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}
ref: ${{ github.head_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip' # caching pip dependencies
- name: Install requirements
shell: bash
run: |
python -m pip install --disable-pip-version-check --no-python-version-warning build
python -m pip install --disable-pip-version-check --no-python-version-warning -e .
- name: Set dev version
shell: bash
run: |
export PR_NUMBER=$(gh pr view --json number -q .number || echo "")
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
echo "::notice::PR_NUMBER is: ${PR_NUMBER}"
bump-my-version bump dev bumpversion/__init__.py --no-commit --no-tag --no-configured-files -v
env:
GH_TOKEN: ${{ secrets.PAT }}
- name: Package
shell: bash
run: |
python -m build
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/