Skip to content

Commit fd4d567

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

File tree

1 file changed

+52
-2
lines changed

1 file changed

+52
-2
lines changed

.github/workflows/build_layer.yml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,33 @@ 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+
run: |
19+
RUN_ID=$(gh run list \
20+
--repo DataDog/dd-trace-py \
21+
--workflow build_deploy.yml \
22+
--branch main \
23+
--status success \
24+
--limit 1 \
25+
--json databaseId \
26+
--jq '.[0].databaseId')
27+
28+
echo "run_id=$RUN_ID" >> $GITHUB_OUTPUT
29+
1030
build:
1131
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
1232

33+
needs: get-ddtrace-run-id
34+
1335
strategy:
1436
fail-fast: false
1537
matrix:
@@ -20,10 +42,38 @@ jobs:
2042
- name: Checkout
2143
uses: actions/checkout@v4
2244

45+
- name: Build artifact name
46+
id: build-artifact-name
47+
run: |
48+
if [ "${{ matrix.arch }}" == "amd64" ]; then
49+
ARCH="x86_64"
50+
else
51+
ARCH="aarch64"
52+
fi
53+
54+
VER="${{ matrix.python_version }}"
55+
PY_VERSION_NO_DOT="${VER//./}"
56+
57+
echo "artifact_name=wheels-cp${PY_VERSION_NO_DOT}-manylinux_${ARCH}" >> $GITHUB_OUTPUT
58+
59+
- name: Download ddtrace Wheel
60+
uses: actions/download-artifact@v4
61+
with:
62+
name: ${{ steps.build-artifact-name.outputs.artifact_name }}
63+
repository: DataDog/dd-trace-py
64+
run-id: ${{ needs.get-ddtrace-run-id.outputs.run-id }}
65+
github-token: ${{ secrets.GITHUB_TOKEN }}
66+
path: ./artifacts
67+
68+
- name: Find ddtrace Wheel
69+
id: find-ddtrace-wheel
70+
run: |
71+
echo "wheel_path=$(find ./artifacts -name "*.whl" | head -n 1)" >> $GITHUB_OUTPUT
72+
2373
- name: Patch pyproject.toml
2474
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
75+
echo "Patching pyproject.toml to use latest build of dd-trace-py"
76+
sed -i 's|^ddtrace =.*$|ddtrace = { file = "./artifacts/${{ steps.find-ddtrace-wheel.outputs.wheel_path }}" }|' pyproject.toml
2777
2878
- name: Build layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}
2979
run: |

0 commit comments

Comments
 (0)