Add Swerve Setpoint Generator to PPLib Python #1137
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PathPlannerLib | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
env: | |
VERSION_NAME: 0.0.0-dev-${{ github.run_number }} | |
jobs: | |
formatting: | |
name: "[PPLib] Check Formatting" | |
runs-on: ubuntu-22.04 | |
container: wpilib/ubuntu-base:22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ./pathplannerlib | |
- name: Check formatting | |
run: ./gradlew spotlessCheck | |
working-directory: ./pathplannerlib | |
test: | |
name: "[PPLib] Unit Tests" | |
runs-on: ubuntu-22.04 | |
container: wpilib/ubuntu-base:22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ./pathplannerlib | |
- name: Build & Test | |
run: ./gradlew build | |
working-directory: ./pathplannerlib | |
# - name: Upload coverage reports to Codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# name: pplib-coverage | |
# files: pathplannerlib/build/reports/jacoco/test/jacocoTestReport.xml | |
test-python: | |
name: "[PPLib Python] Unit Tests" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
working-directory: ./pathplannerlib-python | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test with pytest | |
working-directory: ./pathplannerlib-python | |
run: pytest | |
build-python: | |
name: "[PPLib Python] Build" | |
runs-on: ubuntu-22.04 | |
needs: [test-python] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
working-directory: ./pathplannerlib-python | |
run: | | |
python -m pip install --upgrade pip | |
pip install build | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Set version | |
run: sed -i "s/0.0.0/${{ env.VERSION_NAME }}/g" pyproject.toml | |
working-directory: ./pathplannerlib-python | |
- name: Build | |
working-directory: ./pathplannerlib-python | |
run: python -m build | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: robotpy-pathplannerlib | |
path: pathplannerlib-python/dist | |
build-docker: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- container: wpilib/roborio-cross-ubuntu:2024-22.04 | |
artifact-name: PPLib-Athena | |
build-options: "-Ponlylinuxathena" | |
- container: wpilib/ubuntu-base:22.04 | |
artifact-name: PPLib-Linux | |
build-options: "-Ponlylinuxx86-64" | |
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04 | |
artifact-name: PPLib-Arm32 | |
build-options: "-Ponlylinuxarm32" | |
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04 | |
artifact-name: PPLib-Arm64 | |
build-options: "-Ponlylinuxarm64" | |
name: "[PPLib] Build - ${{ matrix.artifact-name }}" | |
needs: [formatting, test] | |
runs-on: ubuntu-22.04 | |
container: ${{ matrix.container }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
working-directory: ./pathplannerlib | |
- name: Set version | |
run: sed -i "s/0.0.0/${{ env.VERSION_NAME }}/g" publish.gradle | |
working-directory: ./pathplannerlib | |
- name: Ensure spotless is applied | |
run: ./gradlew spotlessApply | |
working-directory: ./pathplannerlib | |
- name: Build | |
run: ./gradlew build ${{ matrix.build-options }} | |
working-directory: ./pathplannerlib | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: pathplannerlib/build/allOutputs | |
build-host: | |
env: | |
MACOSX_DEPLOYMENT_TARGET: 13.3 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-2022 | |
artifact-name: PPLib-Win64 | |
os-name: windows | |
- os: macos-15 | |
artifact-name: PPLib-macOS | |
os-name: macos | |
name: "[PPLib] Build - ${{ matrix.artifact-name }}" | |
needs: [formatting, test] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Set version | |
if: ${{ matrix.os-name != 'macos' }} | |
run: sed -i "s/0.0.0/${{ env.VERSION_NAME }}/g" publish.gradle | |
working-directory: ./pathplannerlib | |
- name: Set version (mac) | |
if: ${{ matrix.os-name == 'macos' }} | |
run: sed -i '' "s/0.0.0/${{ env.VERSION_NAME }}/g" publish.gradle | |
working-directory: ./pathplannerlib | |
- name: Ensure spotless is applied | |
run: ./gradlew spotlessApply | |
working-directory: ./pathplannerlib | |
- name: Build | |
run: ./gradlew build -Pbuildalldesktop | |
working-directory: ./pathplannerlib | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: pathplannerlib/build/allOutputs | |
combine: | |
name: "[PPLib] Combine" | |
needs: [build-docker, build-host] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout build-tools | |
uses: actions/checkout@v4 | |
with: | |
repository: wpilibsuite/build-tools | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: combiner/products/build/allOutputs | |
- name: Flatten Artifacts | |
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/ | |
- name: Setup java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'zulu' | |
- name: Combine | |
run: ./gradlew publish -Pthirdparty | |
working-directory: combiner | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PPLib-Maven-v${{ env.VERSION_NAME }} | |
path: ~/releases |