Skip to content

Add SysId examples to C++ and Python #168

Add SysId examples to C++ and Python

Add SysId examples to C++ and Python #168

# This is a faster workflow that parallelizes the jobs in a matrix so
# we can get faster results than waiting for the standard build_all_frc_projects
# powershell script
name: Build all FRC Projects
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- project-name: 'BasicLatencyCompensation'
directory: 'cpp/BasicLatencyCompensation'
- project-name: 'CANcoder'
directory: 'cpp/CANcoder'
- project-name: 'CommandBasedDrive'
directory: 'cpp/CommandBasedDrive'
- project-name: 'ControlRequestLimits'
directory: 'cpp/ControlRequestLimits'
- project-name: 'CurrentLimits'
directory: 'cpp/CurrentLimits'
- project-name: 'Falcon500ArcadeDrive'
directory: 'cpp/Falcon500ArcadeDrive'
- project-name: 'FusedCANcoder'
directory: 'cpp/FusedCANcoder'
- project-name: 'MotionMagic'
directory: 'cpp/MotionMagic'
- project-name: 'PhoenixSysId'
directory: 'cpp/PhoenixSysId'
- project-name: 'Pigeon2'
directory: 'cpp/Pigeon2'
- project-name: 'PositionClosedLoop'
directory: 'cpp/PositionClosedLoop'
- project-name: 'Simulation'
directory: 'cpp/Simulation'
- project-name: 'VelocityClosedLoop'
directory: 'cpp/VelocityClosedLoop'
- project-name: 'WaitForAll'
directory: 'cpp/WaitForAll'
- project-name: 'BasicLatencyCompensation'
directory: 'java/BasicLatencyCompensation'
- project-name: 'CANcoder'
directory: 'java/CANcoder'
- project-name: 'CommandBasedDrive'
directory: 'java/CommandBasedDrive'
- project-name: 'ControlRequestLimits'
directory: 'java/ControlRequestLimits'
- project-name: 'CurrentLimits'
directory: 'java/CurrentLimits'
- project-name: 'Falcon500ArcadeDrive'
directory: 'java/Falcon500ArcadeDrive'
- project-name: 'FusedCANcoder'
directory: 'java/FusedCANcoder'
- project-name: 'MotionMagic'
directory: 'java/MotionMagic'
- project-name: 'PhoenixSysId'
directory: 'java/PhoenixSysId'
- project-name: 'Pigeon2'
directory: 'java/Pigeon2'
- project-name: 'PositionClosedLoop'
directory: 'java/PositionClosedLoop'
- project-name: 'Simulation'
directory: 'java/Simulation'
- project-name: 'SwerveWithPathPlanner'
directory: 'java/SwerveWithPathPlanner'
- project-name: 'VelocityClosedLoop'
directory: 'java/VelocityClosedLoop'
- project-name: 'WaitForAll'
directory: 'java/WaitForAll'
# The type of runner that the job will run on
runs-on: ubuntu-latest
# This grabs the WPILib docker container
container: wpilib/roborio-cross-ubuntu:2024-22.04
steps:
- uses: actions/checkout@v4
# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: cd "${{ matrix.directory }}" && chmod +x gradlew
# Runs a single command using the runners shell
- name: Compile and run tests on robot code for project ${{ matrix.project-name }}
run: cd "${{ matrix.directory }}" && ./gradlew build
build-python:
strategy:
fail-fast: false
matrix:
python_version: ['3.9', '3.10', '3.11']
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
project-name: ['ArcadeDrive', 'CANcoder', 'PhoenixSysId', 'PositionClosedLoop', 'StatusSignals', 'TalonFX']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install python dependencies
run: |
pip install -U pip
pip install robotpy robotpy_commands_v2 phoenix6
- name: Test ${{ matrix.project-name }}
run: |
cd "python/${{ matrix.project-name }}" && python3 -m robotpy test