-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (128 loc) · 4.59 KB
/
Copy pathcompatibility.yml
File metadata and controls
150 lines (128 loc) · 4.59 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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Compatibility tests run only manually (workflow_dispatch). No automatic run on PR/push.
name: Compatibility
on:
workflow_dispatch:
concurrency:
group: compatibility-${{ github.ref }}
cancel-in-progress: false
jobs:
check-validation:
name: check-validation
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
pull-requests: read
steps:
- name: Placeholder (manual run only)
run: echo "Compatibility workflow running manually"
docker-test:
name: docker-test
needs: check-validation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os-variant: ['ubuntu:20.04', 'ubuntu:22.04', 'debian:bullseye', 'alpine:3.18']
exclude:
- python-version: '3.8'
os-variant: 'alpine:3.18'
- python-version: '3.9'
os-variant: 'alpine:3.18'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build test container
run: |
cat > dev/Dockerfile.test.tmp <<EOF
FROM ${{ matrix.os-variant }}
RUN apt-get update && apt-get install -y python${{ matrix.python-version }} python3-pip curl
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
COPY . .
RUN /root/.cargo/bin/uv sync --dev
CMD ["/root/.cargo/bin/uv", "run", "pytest", "-c", "dev/pytest.ini", "tests/unit/", "-v"]
EOF
- name: Run tests in container
run: |
docker build -f dev/Dockerfile.test.tmp -t ccbt-test:${{ matrix.python-version }}-${{ matrix.os-variant }} .
docker run --rm ccbt-test:${{ matrix.python-version }}-${{ matrix.os-variant }}
live-deployment-test:
name: live-deployment-test
needs: check-validation
runs-on: ubuntu-latest
if: |
(github.ref == 'refs/heads/main' && github.event_name == 'push' && needs.check-validation.result == 'success') ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v4
- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv sync --dev
- name: Build package
run: |
uv run python -m build
- name: Install from wheel
run: |
uv pip install dist/*.whl
- name: Test installation
run: |
ccbt --version || echo "ccbt command not available (expected)"
btbt --version || echo "btbt command not available (expected)"
bitonic --version || echo "bitonic command not available (expected)"
- name: Run smoke tests
run: |
uv run pytest -c dev/pytest.ini tests/integration/test_basic_download.py -v
compatibility-tests:
name: compatibility-tests
needs: check-validation
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
(github.event_name == 'pull_request' && needs.check-validation.result == 'success') ||
(github.event_name == 'push' && needs.check-validation.result == 'success')
steps:
- uses: actions/checkout@v4
- name: Install UV
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
uv sync --dev
- name: Run compatibility tests
continue-on-error: true # Don't fail CI if compatibility tests fail (network may be flaky)
run: |
uv run pytest -c dev/pytest.ini tests/compatibility/ \
-m "compatibility" \
--timeout=600 \
--timeout-method=thread \
-v \
--tb=short
- name: Upload compatibility test results
if: always()
uses: actions/upload-artifact@v4
with:
name: compatibility-test-results
path: |
site/reports/junit.xml
site/reports/pytest.log
retention-days: 30