From c0b6ce619455abd8ba0fbead731f561f54df8ef4 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 27 Aug 2025 15:06:54 -0700 Subject: [PATCH 1/3] Cache linux dependencies to reduce failures We have been seeing some failures while downloading dependencies for linux builds. Lets cache them for each workflow run to reduce potential failures. --- .github/workflows/build-native-action.yml | 53 +++++++++++++++++------ 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index b0c70e0b..e609642f 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -10,8 +10,30 @@ on: jobs: - build_linux: + download-dependencies: + name: Download Python Build Dependencies + runs-on: + - ubuntu-24.04 + strategy: + fail-fast: true + env: + RELENV_DATA: ${{ github.workspace }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Download Dependencies + run: | + python3 -m relenv build --download-only + - name: Cache Dependencies + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/download + key: ${{ github.run_id }}-dependencies + build_linux: strategy: fail-fast: false matrix: @@ -28,16 +50,16 @@ jobs: target: x86_64 - host: aarch64 target: aarch64 - + needs: + - download-dependencies name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}" runs-on: - ${{ (contains(matrix.host, 'x86_64') && 'ubuntu-24.04') || 'ubuntu-24.04-arm' }} - env: RELENV_DATA: ${{ github.workspace }} - steps: - name: "Throttle Builds" + if: false shell: bash run: | t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" @@ -61,6 +83,12 @@ jobs: venv/bin/python3 --version venv/bin/python3 -c 'import os; print(os.name)' + - name: Restore Cached Dependencies + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/download + key: ${{ github.run_id }}-dependencies + - name: Build run: | venv/bin/python3 -m relenv build --no-pretty --arch=${{ matrix.target }} --python=${{ matrix.version }} @@ -83,9 +111,7 @@ jobs: build_macos_12_x86_64: name: "Python macOS" - runs-on: macos-13 - strategy: fail-fast: false matrix: @@ -96,12 +122,11 @@ jobs: - 3.13.5 arch: - x86_64 - env: RELENV_DATA: ${{ github.workspace }} - steps: - name: "Throttle Builds" + if: false shell: bash run: | t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" @@ -160,11 +185,15 @@ jobs: - 3.13.5 arch: - arm64 - env: RELENV_DATA: ${{ github.workspace }} - steps: + - name: "Throttle Builds" + if: false + shell: bash + run: | + t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" + - uses: actions/checkout@v3 - name: Patch include @@ -207,7 +236,6 @@ jobs: build_windows: name: "Python Windows" runs-on: windows-latest - strategy: fail-fast: false matrix: @@ -219,12 +247,11 @@ jobs: arch: - amd64 - x86 - env: RELENV_DATA: ${{ github.workspace }} - steps: - name: "Throttle Builds" + if: false shell: bash run: | t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" From 997ff5f9d59003766f0f60885cabff106b862da1 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 27 Aug 2025 15:33:12 -0700 Subject: [PATCH 2/3] Fix syntax wart --- .github/workflows/build-cross-action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-cross-action.yml b/.github/workflows/build-cross-action.yml index bf957b4d..81964d61 100644 --- a/.github/workflows/build-cross-action.yml +++ b/.github/workflows/build-cross-action.yml @@ -32,12 +32,10 @@ jobs: name: "Python ${{ matrix.version }} Linux ${{ matrix.target }} on ${{ matrix.host }}" - if: | - ( matrix.host == matrix.target && inputs.kind == "native" ) || - ( matrix.host != matrix.target && inputs.kind == "cross" ) + # if: ${{ ( matrix.host == matrix.target && inputs.kind == 'native' ) || ( matrix.host != matrix.target && inputs.kind == 'cross' ) }} runs-on: - - ${{ (contains(matrix.host, "x86_64") && "ubuntu-24.04") || "ubuntu-24.04-arm" }} + - ${{ (contains(matrix.host, 'x86_64') && 'ubuntu-24.04') || 'ubuntu-24.04-arm' }} env: RELENV_DATA: ${{ github.workspace }} From 086fbb82f83d20dea893eec0fb0157172c7c21a9 Mon Sep 17 00:00:00 2001 From: "Daniel A. Wozniak" Date: Wed, 27 Aug 2025 16:18:50 -0700 Subject: [PATCH 3/3] Allow missing prereqs for download-only --- relenv/build/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relenv/build/common.py b/relenv/build/common.py index e5918d24..209d4cac 100644 --- a/relenv/build/common.py +++ b/relenv/build/common.py @@ -1251,7 +1251,7 @@ def __call__( steps = self.recipies failures = self.check_prereqs() - if failures: + if not download_only and failures: for _ in failures: sys.stderr.write(f"{_}\n") sys.stderr.flush()