Skip to content

Commit

Permalink
Add CI with actions (#4)
Browse files Browse the repository at this point in the history
Build for desktop platforms
  • Loading branch information
sciencewhiz authored Jan 2, 2025
1 parent 6a5b635 commit 8d7ff2e
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 5 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on: [push, pull_request]

jobs:

validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4

build-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2025-22.04
artifact-name: Athena
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
artifact-name: Arm32
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
artifact-name: Arm64
- container: wpilib/ubuntu-base:22.04
artifact-name: Linux
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
needs: [validation]
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Fetch all history and metadata
run: |
git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- name: Build with Gradle Java
working-directory: Java
run: ./gradlew build
- name: Build with Gradle C++
working-directory: Cpp
run: ./gradlew build

build-host:
env:
MACOSX_DEPLOYMENT_TARGET: 13.3
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
artifact-name: Win64
architecture: x64
- os: macos-14
artifact-name: macOS
architecture: aarch64
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
needs: [validation]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Fetch all history and metadata
run: git fetch --prune --unshallow
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
architecture: ${{ matrix.architecture }}
- name: Build with Gradle Java
working-directory: Java
run: ./gradlew build
- name: Build with Gradle C++
working-directory: Cpp
run: ./gradlew build
10 changes: 5 additions & 5 deletions Cpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ wpi.cpp.debugSimulation = false

def appName = "TestApplication"

nativeUtils.withCrossLinuxArm64()
//nativeUtils.withCrossLinuxArm32() // Uncomment to build for arm32. targetPlatform below also needs to be fixed
//nativeUtils.withCrossLinuxArm64() // Uncomment to build for Linux Arm 64. targetPlatform below also needs to be fixed
//nativeUtils.withCrossLinuxArm32() // Uncomment to build for Linux Arm 32. targetPlatform below also needs to be fixed

model {
components {
"${appName}"(NativeExecutableSpec) {
//targetPlatform wpi.platforms.desktop // Uncomment to build on whatever the native platform currently is
targetPlatform wpi.platforms.linuxarm64
//targetPlatform wpi.platforms.linuxarm32 // Uncomment to build for arm32
targetPlatform wpi.platforms.desktop // Uncomment to build on whatever the native platform currently is
//targetPlatform wpi.platforms.linuxarm64 // Uncomment to build for Linux Arm 64
//targetPlatform wpi.platforms.linuxarm32 // Uncomment to build for Linux Arm 32

sources.cpp {
source {
Expand Down

0 comments on commit 8d7ff2e

Please sign in to comment.