Skip to content

Commit 3cf4fb8

Browse files
authored
V5.0.1 (#12)
* V5.0.1 * V5.0.1 * V5.0.1 * V5.0.1 * V5.0.1 * V5.0.1 * V5.0.1 --------- Co-authored-by: ddc <ddc@users.noreply.github.com>
1 parent a6f5f4a commit 3cf4fb8

39 files changed

+4461
-2078
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 153 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,93 @@
11
name: CI/CD Pipeline
22

3-
on:
3+
4+
"on":
45
push:
5-
branches: [main, master]
6+
branches: ["**"]
67
tags: ['v*']
78

89

910
jobs:
11+
test:
12+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
13+
runs-on: ${{ matrix.runs-on || matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
18+
python-version: ["3.12", "3.13"]
19+
include:
20+
- os: "macos-14-arm64"
21+
runs-on: "macos-14"
22+
python-version: "3.12"
23+
- os: "macos-14-arm64"
24+
runs-on: "macos-14"
25+
python-version: "3.13"
26+
- os: "ubuntu-latest-arm64"
27+
runs-on: "ubuntu-latest"
28+
python-version: "3.12"
29+
arch: "arm64"
30+
- os: "ubuntu-latest-arm64"
31+
runs-on: "ubuntu-latest"
32+
python-version: "3.13"
33+
arch: "arm64"
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Set up QEMU for ARM64 emulation
38+
if: matrix.arch == 'arm64'
39+
uses: docker/setup-qemu-action@v3
40+
with:
41+
platforms: arm64
42+
43+
- name: Set up Python ${{ matrix.python-version }}
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Install Poetry
49+
uses: snok/install-poetry@v1
50+
with:
51+
virtualenvs-create: true
52+
virtualenvs-in-project: true
53+
54+
- name: Install dependencies
55+
run: poetry install --with test --no-interaction --no-ansi
56+
shell: bash
57+
58+
- name: Run tests with coverage
59+
run: poetry run poe tests
60+
shell: bash
61+
62+
- name: Upload coverage to Codecov
63+
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
64+
uses: codecov/codecov-action@v5
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}
67+
slug: ddc/pythonLogs
68+
69+
- name: Upload test results to Codecov
70+
if: matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest'
71+
uses: codecov/test-results-action@v1
72+
with:
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
slug: ddc/pythonLogs
75+
1076
build:
1177
name: Build for Python ${{ matrix.python-version }} on ${{ matrix.os }}
12-
runs-on: ${{ matrix.os }}
78+
runs-on: ${{ matrix.runs-on || matrix.os }}
1379
if: startsWith(github.ref, 'refs/tags/v')
1480
strategy:
1581
matrix:
16-
os: [ubuntu-latest, windows-latest, macos-latest]
82+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
1783
python-version: ["3.12", "3.13"]
84+
include:
85+
- os: "macos-14-arm64"
86+
runs-on: "macos-14"
87+
python-version: "3.12"
88+
- os: "macos-14-arm64"
89+
runs-on: "macos-14"
90+
python-version: "3.13"
1891
steps:
1992
- uses: actions/checkout@v4
2093

@@ -30,7 +103,12 @@ jobs:
30103
virtualenvs-in-project: true
31104

32105
- name: Install build dependencies only
33-
run: poetry install --only main --no-interaction --no-ansi
106+
run: |
107+
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
108+
poetry install --only main --no-interaction --no-ansi -E mongodb -E mssql -E mysql -E oracle
109+
else
110+
poetry install --only main --no-interaction --no-ansi -E all
111+
fi
34112
shell: bash
35113

36114
- name: Build package with custom build script
@@ -53,10 +131,79 @@ jobs:
53131
path: dist-py${{ matrix.python-version }}-${{ matrix.os }}/
54132
retention-days: 7
55133

134+
build-linux-arm64:
135+
name: Build Linux ARM64 wheels
136+
runs-on: ubuntu-latest
137+
if: startsWith(github.ref, 'refs/tags/v')
138+
strategy:
139+
matrix:
140+
python-version: ["3.12", "3.13"]
141+
steps:
142+
- uses: actions/checkout@v4
143+
144+
- name: Set up Docker Buildx
145+
uses: docker/setup-buildx-action@v3
146+
with:
147+
platforms: linux/arm64
148+
149+
- name: Build ARM64 wheel using Docker
150+
run: |
151+
# Create a multi-stage Dockerfile for ARM64 builds
152+
cat << 'EOF' > Dockerfile.arm64
153+
FROM python:${{ matrix.python-version }}-slim
154+
155+
WORKDIR /build
156+
157+
# Install build dependencies
158+
RUN apt-get update && apt-get install -y \
159+
build-essential \
160+
git \
161+
&& rm -rf /var/lib/apt/lists/*
162+
163+
# Install Poetry
164+
RUN pip install poetry
165+
166+
# Copy project files
167+
COPY . .
168+
169+
# Configure Poetry and build
170+
RUN poetry config virtualenvs.create false \
171+
&& poetry install --only main --no-interaction --no-ansi \
172+
&& poetry run python build.py \
173+
&& poetry build
174+
175+
# Copy artifacts to output volume
176+
CMD ["cp", "-r", "dist/", "/output/"]
177+
EOF
178+
179+
# Build using buildx for ARM64
180+
docker buildx build \
181+
--platform linux/arm64 \
182+
--file Dockerfile.arm64 \
183+
--tag pythonlogs-arm64-builder:${{ matrix.python-version }} \
184+
--load \
185+
.
186+
187+
# Create output directory
188+
mkdir -p dist-arm64-py${{ matrix.python-version }}
189+
190+
# Run container to extract artifacts
191+
docker run --rm \
192+
--platform linux/arm64 \
193+
-v $(pwd)/dist-arm64-py${{ matrix.python-version }}:/output \
194+
pythonlogs-arm64-builder:${{ matrix.python-version }}
195+
196+
- name: Upload Linux ARM64 Python ${{ matrix.python-version }} artifacts
197+
uses: actions/upload-artifact@v4
198+
with:
199+
name: python-packages-${{ matrix.python-version }}-linux-arm64
200+
path: dist-arm64-py${{ matrix.python-version }}/
201+
retention-days: 7
202+
56203
release:
57204
name: Create Release
58205
runs-on: ubuntu-latest
59-
needs: build
206+
needs: [build, build-linux-arm64]
60207
if: startsWith(github.ref, 'refs/tags/v')
61208
permissions:
62209
contents: write

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,4 @@ cython_debug/
162162
/profile_fixed.prof
163163
/profile_output.prof
164164
/profile_pytest.prof
165+
/junit.xml

0 commit comments

Comments
 (0)