Skip to content

Commit 991b79b

Browse files
committed
ci(system-tests): reuse dd-trace-py artifacts instead of building
1 parent ea7ad6e commit 991b79b

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

.github/workflows/build_layer.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,35 @@ on:
55
push:
66
branches:
77
- "main"
8+
- "florentin.labelle/fix-system-tests-build"
89

910
jobs:
11+
get-ddtrace-run-id:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
run-id: ${{ steps.get-ddtrace-run-id.outputs.run_id }}
15+
steps:
16+
- name: Resolve Run ID of latest dd-trace-py build
17+
id: get-ddtrace-run-id
18+
env:
19+
GH_TOKEN: ${{ github.token }}
20+
run: |
21+
RUN_ID=$(gh run list \
22+
--repo DataDog/dd-trace-py \
23+
--workflow build_deploy.yml \
24+
--branch main \
25+
--status success \
26+
--limit 1 \
27+
--json databaseId \
28+
--jq '.[0].databaseId')
29+
30+
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
31+
1032
build:
1133
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
1234

35+
needs: get-ddtrace-run-id
36+
1337
strategy:
1438
fail-fast: false
1539
matrix:
@@ -20,10 +44,38 @@ jobs:
2044
- name: Checkout
2145
uses: actions/checkout@v4
2246

47+
- name: Build artifact name
48+
id: build-artifact-name
49+
run: |
50+
if [ "${{ matrix.arch }}" == "amd64" ]; then
51+
ARCH="x86_64"
52+
else
53+
ARCH="aarch64"
54+
fi
55+
56+
VER="${{ matrix.python_version }}"
57+
PY_VERSION_NO_DOT="${VER//./}"
58+
59+
echo "artifact_name=wheels-cp${PY_VERSION_NO_DOT}-manylinux_${ARCH}" >> $GITHUB_OUTPUT
60+
61+
- name: Download ddtrace Wheel
62+
uses: actions/download-artifact@v4
63+
with:
64+
name: ${{ steps.build-artifact-name.outputs.artifact_name }}
65+
repository: DataDog/dd-trace-py
66+
run-id: ${{ needs.get-ddtrace-run-id.outputs.run-id }}
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
path: ./artifacts
69+
70+
- name: Find ddtrace Wheel
71+
id: find-ddtrace-wheel
72+
run: |
73+
echo "wheel_path=$(find ./artifacts -name "*.whl" | head -n 1)" >> $GITHUB_OUTPUT
74+
2375
- name: Patch pyproject.toml
2476
run: |
25-
echo "Patching pyproject.toml to use main branch of dd-trace-py"
26-
sed -i 's|^ddtrace =.*$|ddtrace = { git = "https://github.com/DataDog/dd-trace-py.git" }|' pyproject.toml
77+
echo "Patching pyproject.toml to use latest build of dd-trace-py"
78+
sed -i 's|^ddtrace =.*$|ddtrace = { file = "./artifacts/${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" }|' pyproject.toml
2779
2880
- name: Build layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}
2981
run: |

0 commit comments

Comments
 (0)