Skip to content

Commit 9855462

Browse files
committed
build wheel for test
1 parent 910c2d8 commit 9855462

File tree

5 files changed

+38
-7
lines changed

5 files changed

+38
-7
lines changed

.github/workflows/CI.yaml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,34 @@ jobs:
128128
outputs:
129129
matrix: ${{ steps.set-matrix.outputs.matrix }}
130130

131+
build-wheel:
132+
name: Build Wheel
133+
needs: [ license-and-lint, changes, plugin-doc-check ]
134+
if: |
135+
( always() && ! cancelled() ) &&
136+
((github.event_name == 'schedule' && github.repository == 'apache/skywalking-python') || needs.changes.outputs.agent == 'true')
137+
runs-on: ubuntu-latest
138+
steps:
139+
- name: Checkout source codes
140+
uses: actions/checkout@v4
141+
with:
142+
submodules: true
143+
persist-credentials: false
144+
- name: Build Wheel
145+
run: |
146+
make env
147+
make wheel
148+
- name: Upload Wheel
149+
uses: actions/upload-artifact@v4
150+
with:
151+
name: apache_skywalking.whl
152+
path: dist/apache_skywalking-$(poetry version | sed 's/apache-skywalking //g')-py3-none-any.whl
153+
retention-days: 1
154+
131155
docker-plugin:
132156
# build docker image for plugin tests, with matrix of Python versions
133157
name: Build Plugin Test Image
134-
needs: [ license-and-lint, changes, plugin-doc-check, prep-plugin-and-unit-tests ]
158+
needs: [ license-and-lint, changes, plugin-doc-check, build-wheel, prep-plugin-and-unit-tests ]
135159
if: |
136160
( always() && ! cancelled() ) &&
137161
((github.event_name == 'schedule' && github.repository == 'apache/skywalking-python') || needs.changes.outputs.agent == 'true')
@@ -148,6 +172,11 @@ jobs:
148172
with:
149173
submodules: true
150174
persist-credentials: false
175+
- name: Download wheel
176+
uses: actions/download-artifact@v4
177+
with:
178+
name: apache_skywalking.whl
179+
path: apache_skywalking.whl
151180
- name: Build SkyWalking Python agent base plugin image
152181
run: |
153182
docker build --build-arg BASE_PYTHON_IMAGE -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ test: env
100100
docker build --build-arg BASE_PYTHON_IMAGE=3.8-slim -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
101101
poetry run pytest -v $(bash tests/gather_test_paths.sh)
102102

103+
.PHONY: wheel
104+
wheel:
105+
poetry build --format wheel
106+
103107
.PHONY: package
104108
package: clean gen
105109
poetry build

docker/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ PUSH_TARGETS := $(TARGETS:%=push-%)
5959
build: $(TARGETS)
6060
push: $(PUSH_TARGETS)
6161

62-
63-
6462
$(TARGETS):
6563
cd ..; \
6664
for p in $(P); do \

tests/e2e/base/Dockerfile.e2e

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ COPY tests/e2e/base/consumer/* /services/
2424
COPY tests/e2e/base/provider/* /services/
2525

2626
# Copy the project and build
27-
COPY . /skywalking-python/
28-
RUN cd /skywalking-python && apt-get update && apt-get install -y make && make install
27+
COPY apache_skywalking.whl /apache_skywalking.whl
28+
RUN pip install /apache_skywalking.whl
2929

3030
# Extra dependencies for e2e services
3131
RUN apt-get update \

tests/plugin/Dockerfile.plugin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ FROM python:${BASE_PYTHON_IMAGE}
1919

2020
WORKDIR /agent
2121

22-
COPY . /agent
22+
COPY apache_skywalking.whl /apache_skywalking.whl
2323

2424
RUN apt-get update \
2525
&& apt-get install -y --no-install-recommends build-essential procps \
26-
&& cd /agent && make install \
26+
&& pip install /apache_skywalking.whl

0 commit comments

Comments
 (0)