From 8db1341b7909a7b5c809b1799e91c85dd7104ab4 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Fri, 2 Jan 2026 21:09:30 -0600 Subject: [PATCH] Download artifacts for testing examples (#2270) Instead of building photon-lib for our examples, wait until it's built elsewhere then use that to run the examples. This means we don't have to build photon-lib twice. --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bd6f2d3e..e8d7a6526 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,13 +28,16 @@ jobs: include: - os: windows-2022 architecture: x64 + artifact-name: Win64 - os: macos-14 architecture: aarch64 + artifact-name: macOS - os: ubuntu-24.04 + artifact-name: Linux name: "Photonlib - Build Examples - ${{ matrix.os }}" runs-on: ${{ matrix.os }} - needs: [validation] + needs: [validation, build-photonlib-host, build-photonlib-docker] steps: - name: Checkout code @@ -55,9 +58,30 @@ jobs: find ~/.gradle/cache/ -name *roborio-academic* -exec rm -rf {} + du -h . | sort -h if: matrix.os == 'ubuntu-24.04' - # Need to publish to maven local first, so that C++ sim can pick it up - - name: Publish photonlib to maven local - run: ./gradlew photon-targeting:publishtomavenlocal photon-lib:publishtomavenlocal -x check + # Download prebuilt photonlib artifacts + - uses: actions/download-artifact@v4 + with: + name: maven-${{ matrix.artifact-name }} + - uses: actions/download-artifact@v4 + with: + name: maven-Athena + - name: Move to maven local + run: | + mkdir -p ~/.m2/repository/ + mv maven/org ~/.m2/repository/ + - name: Copy vendordeps + shell: bash + run: | + for vendordep_folder in photonlib-*-examples/*/; do + # Remove trailing slash for cross-platform compatibility + vendordep_folder="${vendordep_folder%/}" + + # Filter for projects only + if [ -e "$vendordep_folder/build.gradle" ]; then + mkdir -p "$vendordep_folder/vendordeps/" + cp vendordeps/photonlib-json-1.0.json "$vendordep_folder/vendordeps/" + fi + done - name: Build Java examples working-directory: photonlib-java-examples run: |