From d4985b8ba062eec75f76dd8e40acb1282d2dc6c4 Mon Sep 17 00:00:00 2001 From: sciencewhiz Date: Sun, 29 Dec 2024 21:47:45 -0800 Subject: [PATCH] [ci] Build RobotPy in tools workflow (#6800) --- .github/workflows/tools.yml | 57 ++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 453c6b3231..b2b0a91d1a 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -35,7 +35,7 @@ jobs: with: image: wpilib/roborio-cross-ubuntu:2025-22.04 options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI -e DISPLAY - run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :fieldImages:publish :epilogue-processor:publish :epilogue-runtime:publish :thirdparty:googletest:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work + run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :simulation:halsim_ws_server:publish :simulation:halsim_ws_client:publish :simulation:halsim_xrp:publish :fieldImages:publish :romiVendordep:publish :xrpVendordep:publish :epilogue-processor:publish :epilogue-runtime:publish :thirdparty:googletest:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work - uses: actions/upload-artifact@v4 with: name: MavenArtifacts @@ -149,3 +149,58 @@ jobs: path: | build/allOutputs/ retention-days: 7 + + Robotpy: + name: "Build - Robotpy" + needs: [build-artifacts] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + repository: robotpy/mostrobotpy + fetch-depth: 0 + - uses: actions/download-artifact@v4 + with: + name: MavenArtifacts + - name: Move artifacts + run: mkdir -p ~/releases/maven/development && cp -r edu ~/releases/maven/development + + - uses: actions/setup-python@v5 + with: + python-version: 3.13 + + # + # Setup build caching + # + + - name: Set ccache size + shell: bash + id: ccache + run: echo "MAX_SIZE=500M" >> $GITHUB_OUTPUT + + - name: Setup ccache + # uses: hendrikmuhs/ccache-action@v1.2.10 + uses: robotpy/ccache-action@fork + with: + key: ubuntu-22.04-3.13 + variant: ccache + max-size: ${{ steps.ccache.outputs.max_size }} + + - name: Install deps + shell: bash + run: | + python -m pip --disable-pip-version-check install -r rdev_requirements.txt + + - name: Install numpy (needed for stubgen but broken in raspbian CI) + shell: bash + run: | + python -m pip --disable-pip-version-check install numpy + - name: Patch RobotPy rdev to use local development + run: git config user.name github-actions && git config user.email github-actions@github.com && set -- ~/releases/maven/development/edu/wpi/first/wpiutil/wpiutil-cpp/*/ ; wpilibversion=$(basename $1) && echo $wpilibversion && sed --regexp-extended -i 's@(wpilib_bin_url =).*@\1 \"file:\/\/'"$HOME"'\/releases\/maven\/development"@' rdev.toml && sed --regexp-extended -i 's/(wpilib_bin_version =).*/\1 \"'"$wpilibversion"'\"/' rdev.toml && ./rdev.sh update-pyproject --commit + - name: Build + test wheels + shell: bash + run: | + ./rdev.sh ci run + env: + RPYBUILD_STRIP_LIBPYTHON: "1" + RPYBUILD_CC_LAUNCHER: ccache