Skip to content

Commit 8d7ff2e

Browse files
authored
Add CI with actions (#4)
Build for desktop platforms
1 parent 6a5b635 commit 8d7ff2e

File tree

2 files changed

+83
-5
lines changed

2 files changed

+83
-5
lines changed

.github/workflows/main.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
validation:
8+
name: "Validation"
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: gradle/actions/wrapper-validation@v4
13+
14+
build-docker:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- container: wpilib/roborio-cross-ubuntu:2025-22.04
20+
artifact-name: Athena
21+
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
22+
artifact-name: Arm32
23+
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
24+
artifact-name: Arm64
25+
- container: wpilib/ubuntu-base:22.04
26+
artifact-name: Linux
27+
name: "Build - ${{ matrix.artifact-name }}"
28+
runs-on: ubuntu-22.04
29+
container: ${{ matrix.container }}
30+
needs: [validation]
31+
steps:
32+
- uses: actions/checkout@v4
33+
with:
34+
submodules: true
35+
fetch-depth: 0
36+
- name: Fetch all history and metadata
37+
run: |
38+
git config --global --add safe.directory /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
39+
- name: Build with Gradle Java
40+
working-directory: Java
41+
run: ./gradlew build
42+
- name: Build with Gradle C++
43+
working-directory: Cpp
44+
run: ./gradlew build
45+
46+
build-host:
47+
env:
48+
MACOSX_DEPLOYMENT_TARGET: 13.3
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
include:
53+
- os: windows-2022
54+
artifact-name: Win64
55+
architecture: x64
56+
- os: macos-14
57+
artifact-name: macOS
58+
architecture: aarch64
59+
name: "Build - ${{ matrix.artifact-name }}"
60+
runs-on: ${{ matrix.os }}
61+
needs: [validation]
62+
steps:
63+
- uses: actions/checkout@v4
64+
with:
65+
submodules: true
66+
- name: Fetch all history and metadata
67+
run: git fetch --prune --unshallow
68+
- uses: actions/setup-java@v4
69+
with:
70+
distribution: 'temurin'
71+
java-version: 17
72+
architecture: ${{ matrix.architecture }}
73+
- name: Build with Gradle Java
74+
working-directory: Java
75+
run: ./gradlew build
76+
- name: Build with Gradle C++
77+
working-directory: Cpp
78+
run: ./gradlew build

Cpp/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ wpi.cpp.debugSimulation = false
1111

1212
def appName = "TestApplication"
1313

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

1717
model {
1818
components {
1919
"${appName}"(NativeExecutableSpec) {
20-
//targetPlatform wpi.platforms.desktop // Uncomment to build on whatever the native platform currently is
21-
targetPlatform wpi.platforms.linuxarm64
22-
//targetPlatform wpi.platforms.linuxarm32 // Uncomment to build for arm32
20+
targetPlatform wpi.platforms.desktop // Uncomment to build on whatever the native platform currently is
21+
//targetPlatform wpi.platforms.linuxarm64 // Uncomment to build for Linux Arm 64
22+
//targetPlatform wpi.platforms.linuxarm32 // Uncomment to build for Linux Arm 32
2323

2424
sources.cpp {
2525
source {

0 commit comments

Comments
 (0)