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.
This commit is contained in:
Sam Freund
2026-01-02 21:09:30 -06:00
committed by GitHub
parent 940c3430b8
commit 8db1341b79

View File

@@ -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: |