Skip to content

build(system-tests): fetch manylinux builds from ddtrace #24

build(system-tests): fetch manylinux builds from ddtrace

build(system-tests): fetch manylinux builds from ddtrace #24

Workflow file for this run

name: Build Layers for system-Tests
on:
push:
branches:
- "main"
- "florentinl/fix-glibc-compat"
jobs:
build:
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
strategy:
matrix:
arch: [arm64, amd64]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Download ddtrace wheel from GitHub workflow artifacts
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
WORKFLOWS=$(curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" "https://api.github.com/repos/DataDog/dd-trace-py/actions/workflows/build_deploy.yml/runs?per_page=100")
ARTIFACT_URL=$(echo "$WORKFLOWS" | jq -r '[.workflow_runs[] | select(.conclusion != "failure" and .head_branch == "main" and .status == "completed")][0] | .artifacts_url')
ARTIFACTS=$(curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" "$ARTIFACT_URL")
VERSION_NO_DOT=$(echo ${{ matrix.python_version }} | sed 's/\.//g')
DDTRACE_ARCH=$(if [ "${{ matrix.arch }}" == "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)
ARTIFACT_NAME=wheels-cp${VERSION_NO_DOT}-manylinux_${DDTRACE_ARCH}
ARCHIVE_URL=$(echo "$ARTIFACTS" | jq -r '.artifacts[] | select(.name == "'"${ARTIFACT_NAME}"'") | .archive_download_url')
curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" -L "$ARCHIVE_URL" --output artifacts.zip
unzip artifacts.zip
- name: Patch pyproject.toml
run: |
echo "Patching pyproject.toml to use main branch of dd-trace-py"
sed -i 's|^ddtrace =.*$|ddtrace = { git = "https://github.com/DataDog/dd-trace-py.git" }|' pyproject.toml
- name: Build layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}
run: |
echo "Building layer for Python ${{ matrix.python_version }} on ${{ matrix.arch }}"
ARCH=${{ matrix.arch }} PYTHON_VERSION=${{ matrix.python_version }} ./scripts/build_layers.sh
- name: Upload layer artifact
uses: actions/upload-artifact@v4
with:
path: .layers/datadog_lambda_py-${{ matrix.arch }}-${{ matrix.python_version }}.zip
name: datadog-lambda-python-${{ matrix.python_version }}-${{ matrix.arch }}