-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (68 loc) · 2.05 KB
/
ci.yml
File metadata and controls
71 lines (68 loc) · 2.05 KB
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
name: Test, release
on:
pull_request:
branches: [main]
push:
branches: [main]
tags: ["v*.*.*"]
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
- run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }} --extra dev
- name: Run tests
run: uv run pytest tests
test-s3:
runs-on: ubuntu-latest
# Only on push to main / manual — avoid hitting S3 on every PR
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v7
- run: uv python install 3.13
- name: Install dependencies
run: uv sync --python 3.13 --extra dev --extra s3
- name: Run S3 integration tests
env:
DVX_TEST_S3: "1"
run: uv run pytest tests/test_s3_import.py -v
publish:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Fetch tag annotation
run: git fetch origin tag ${{ github.ref_name }} --force
- uses: astral-sh/setup-uv@v7
- run: uv python install 3.12
- name: Build package
run: uvx --from build pyproject-build --outdir dist
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: uvx twine upload dist/*
- name: Get tag message
id: tag
run: |
TAG_MSG=$(git tag -l --format='%(contents:body)' ${{ github.ref_name }})
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$TAG_MSG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
body: |
${{ steps.tag.outputs.message }}
generate_release_notes: true