mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
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:
32
.github/workflows/build.yml
vendored
32
.github/workflows/build.yml
vendored
@@ -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: |
|
||||
|
||||
Reference in New Issue
Block a user