-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 1.74 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
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.12"
- "3.13"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
name: Checkout the repository
with:
fetch-depth: 0
- uses: ./.github/actions/setup-python-and-git
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: uv sync -p ${{ matrix.python-version }} --group test
- name: Test
run: uv run pytest
# Upload to Test PyPI.
release-test-pypi:
name: Publish in-dev package to test.pypi.org
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup-python-and-git
with:
python-version: "3.12"
- name: Install requirements
shell: bash
run: |
uv sync -p 3.12 --group dev
- 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}"
uv run bump-my-version bump dev --no-commit --no-tag -v
- name: Package
shell: bash
run: |
uv build
- name: Upload package to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/