Skip to content

Simplify build

Simplify build #68

Workflow file for this run

name: CI
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
# build-roborio:
# name: "Build - roboRIO"
# runs-on: ubuntu-latest
# container: wpilib/ubuntu-base:22.04
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-java@v4
# with:
# java-version: 17
# distribution: 'temurin'
# - name: Install Ninja
# run: |
# sudo apt-get update -q
# sudo apt-get install -y ninja-build build-essential
# - run: curl -SL https://github.com/wpilibsuite/opensdk/releases/download/v2024-1/cortexa9_vfpv3-roborio-academic-2024-x86_64-linux-gnu-Toolchain-12.1.0.tgz | tar xzf - --strip-components=2
# name: Replace arm32 compiler
# - name: Install sccache
# uses: mozilla-actions/[email protected]
# - name: Build with CMake
# run: |
# cmake -G Ninja -B build -S . --toolchain toolchain-config.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
# cmake --build build --parallel $(nproc)
# env:
# SCCACHE_GHA_ENABLED: "true"
# - run: ./gradlew publish -Pplatform=arm-frc2024-linux
# name: Build with Gradle
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.artifact-name }}
# path: gradleDir/outputs/
build-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2025-22.04
artifact-name: Athena
build-options: -Pplatform=linuxathena -Psccache
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
artifact-name: Arm32
build-options: -Pplatform=linuxarm32 -Psccache
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
artifact-name: Arm64
build-options: -Pplatform=linuxarm64 -Psccache
- container: wpilib/ubuntu-base:22.04
artifact-name: Linux
build-options: -Pplatform=linux-x86_64 -Psccache
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Install Ninja
run: |
sudo apt-get update -q
sudo apt-get install -y ninja-build build-essential
- name: Install sccache
uses: mozilla-actions/[email protected]
- name: Build with Gradle
run: ./gradlew publish ${{ matrix.build-options }}
env:
SCCACHE_GHA_ENABLED: "true"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: gradleDir/outputs/
build-windows:
strategy:
fail-fast: false
matrix:
include:
- artifact-name: WinArm64
tool-arch: amd64_arm64
build-options: -Pplatform=windows-arm64 -Psccache
- artifact-name: Win64
tool-arch: amd64
build-options: -Pplatform=windows-x86_64 -Psccache
name: "Build - ${{ matrix.artifact-name }}"
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- uses: ilammy/[email protected]
with:
arch: ${{ matrix.tool-arch }}
- name: Install sccache
uses: mozilla-actions/[email protected]
- name: Build with Gradle
run: ./gradlew publish ${{ matrix.build-options }}
env:
SCCACHE_GHA_ENABLED: "true"
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: gradleDir/outputs/
build-mac:
name: "Build - macOS"
runs-on: macOS-14
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- run: brew install cmake ninja
name: install ninja
- name: Install sccache
uses: mozilla-actions/[email protected]
- name: Build with Gradle
run: ./gradlew publish -Pplatform=osx-universal -Psccache
env:
SCCACHE_GHA_ENABLED: "true"
- uses: actions/upload-artifact@v4
with:
name: macOS
path: gradleDir/outputs/
combine:
name: Combine
needs: [build-docker, build-windows, build-mac] # , build-roborio]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: wpilibsuite/build-tools
- 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: Combine
if: |
!startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publish -Pthirdparty
working-directory: combiner
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
- name: Combine (Release)
if: |
github.repository_owner == 'PhotonVision`' &&
startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publish -Pthirdparty -Prelease
env:
ARTIFACTORY_API_KEY: ${{ secrets.ARTIFACTORY_API_KEY }}
working-directory: combiner
- uses: actions/upload-artifact@v4
with:
name: Maven
path: ~/releases