Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/wpilibsuite/RobotBuilder in…
Browse files Browse the repository at this point in the history
…to Devel2025
  • Loading branch information
sciencewhiz committed Jul 29, 2024
2 parents 0a74fc7 + b1bfec3 commit 1c0323e
Show file tree
Hide file tree
Showing 12 changed files with 207 additions and 149 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 526393270fbe745dfbc41edfd5acc5f9ef317adc Mon Sep 17 00:00:00 2001
From: sciencewhiz <sciencewhiz@users.noreply.github.com>
Date: Wed, 13 Mar 2024 06:27:11 -0700
Subject: [PATCH] Disable compile tests until GradleRIO released

---
src/test/java/robotbuilder/exporters/CppExportTest.java | 1 +
src/test/java/robotbuilder/exporters/JavaExportTest.java | 1 +
2 files changed, 2 insertions(+)

diff --git a/src/test/java/robotbuilder/exporters/CppExportTest.java b/src/test/java/robotbuilder/exporters/CppExportTest.java
index dc2acb0..bf8a00c 100644
--- a/src/test/java/robotbuilder/exporters/CppExportTest.java
+++ b/src/test/java/robotbuilder/exporters/CppExportTest.java
@@ -50,6 +50,7 @@ public class CppExportTest {
TestUtils.delete(project);
}

+ @Ignore("Disabling compile test until GradleRIO version released")
@Test
public void testCPPExport() throws IOException, InterruptedException {
RobotTree tree = TestUtils.generateTestTree();
diff --git a/src/test/java/robotbuilder/exporters/JavaExportTest.java b/src/test/java/robotbuilder/exporters/JavaExportTest.java
index f43b8f2..f4e0b93 100644
--- a/src/test/java/robotbuilder/exporters/JavaExportTest.java
+++ b/src/test/java/robotbuilder/exporters/JavaExportTest.java
@@ -52,6 +52,7 @@ public class JavaExportTest {
TestUtils.delete(project);
}

+ @Ignore("Disabling compile test until GradleRIO version released")
@Test
public void testJavaExport() throws IOException, InterruptedException {
RobotTree tree = TestUtils.generateTestTree();
--
2.41.0.windows.1

39 changes: 39 additions & 0 deletions .github/workflows/bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: bump

on: [repository_dispatch]

jobs:
bump:
if: github.event_name == 'repository_dispatch' && github.event.action == 'tag'
runs-on: ubuntu-22.04
env:
DISPLAY: ':10'
steps:
- name: Information
run: |
echo "Version update for ${{ github.event.client_payload.package_name }} -> ${{ github.event.client_payload.package_version }} requested"
- uses: actions/checkout@v4
with:
token: ${{ secrets.TOOL_REPO_ACCESS_TOKEN }}
fetch-depth: 0
- name: Install and run xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb && Xvfb $DISPLAY &
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Tag and push
shell: bash
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git am -3 < .github/workflows/0001-Disable-compile-tests-until-GradleRIO-released-.patch
sed -i 's/wpilibRelease = \".*/wpilibRelease = \"${{ github.event.client_payload.package_version }}\";/' src/main/java/robotbuilder/exporters/GenericExporter.java
./gradlew build test -x htmlSanityCheck
git commit -a -m "Bump export version to ${{ github.event.client_payload.package_version }}"
git push origin
git tag ${{ github.event.client_payload.package_version }}
git push origin ${{ github.event.client_payload.package_version }}
git revert HEAD~1
git push origin
119 changes: 119 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: CI

on: [pull_request, push]

jobs:
test-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
artifact-name: Linux
name: "Test - ${{ matrix.artifact-name }}"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
env:
DISPLAY: ':10'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/actions/wrapper-validation@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Install and start xvfb
run: |
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb $DISPLAY &
- name: Check
run: ./gradlew check -PbuildServer
- name: ${{ matrix.artifact-name }} Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
build/test-results/test/TEST*.xml
- name: ${{ matrix.artifact-name }} Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.artifact-name }}TestReport
path: |
build/reports/
test-host:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
artifact-name: Win64
architecture: x64
- os: macos-12
artifact-name: macOS
architecture: x64
name: "Test - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gradle/actions/wrapper-validation@v3
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
architecture: ${{ matrix.architecture }}
- name: Check
run: ./gradlew check -PbuildServer
- name: ${{ matrix.artifact-name }} Upload Test Results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.artifact-name }}TestReport
path: |
build/reports/
publish:
name: Publish
needs: [test-docker, test-host]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Publish
if: |
!startsWith(github.ref, 'refs/tags/v') &&
github.ref != 'refs/heads/main'
run: ./gradlew publish -PbuildServer
- name: Publish (Main)
if: |
github.repository_owner == 'wpilibsuite' &&
github.ref == 'refs/heads/main'
run: ./gradlew publish -PbuildServer
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Publish (Release)
if: |
github.repository_owner == 'wpilibsuite' &&
startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publish -PbuildServer -PreleaseMode
env:
RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE'
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: RobotBuilder
path: build/libs/RobotBuilder-all.jar
10 changes: 0 additions & 10 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RobotBuilder Project
[![Build Status](https://dev.azure.com/wpilib/DesktopTools/_apis/build/status/wpilibsuite.RobotBuilder)](https://dev.azure.com/wpilib/DesktopTools/_build/latest?definitionId=13)
[![CI](https://github.com/wpilibsuite/RobotBuilder/actions/workflows/ci.yml/badge.svg)](https://github.com/wpilibsuite/RobotBuilder/actions/workflows/ci.yml)

Welcome to the WPILib project. This repository contains the RobotBuilder project. This program can be used to automatically generate Java and C++ FRC programs using the [New Command Framework](https://docs.wpilib.org/en/stable/docs/software/commandbased/index.html).

Expand Down
127 changes: 0 additions & 127 deletions azure-pipelines.yml

This file was deleted.

4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ plugins {
id 'org.aim42.htmlSanityCheck' version '1.1.6'
}

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

wpilibVersioning.buildServerMode = project.hasProperty('buildServer')
wpilibVersioning.releaseMode = project.hasProperty('releaseMode')
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/robotbuilder/exporters/GenericExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ public boolean export(RobotTree robotTree) throws IOException {
}
}
if(wpilibRelease == null) {
wpilibRelease = "2024.3.2"; // this shouldn't need to be relied upon,
// but its better than generating nothing.
// this shouldn't need to be relied upon, but it's better than generating nothing.
wpilibRelease = "v2024.3.2";
wpilibRelease = wpilibRelease.substring(1); // strip leading v from tag
}

// Prepare the main context
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/CommandBasedRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
\#include <frc/smartdashboard/SmartDashboard.h>
\#include <frc2/command/CommandScheduler.h>

void Robot::RobotInit() {
Robot::Robot() {
EnableLiveWindowInTest(true);
HAL_Report(HALUsageReporting::kResourceType_Framework,
HALUsageReporting::kFramework_RobotBuilder);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/export/cpp/CommandBasedRobot.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Robot : public frc::TimedRobot {
public:
void RobotInit() override;
Robot();
void RobotPeriodic() override;
void DisabledInit() override;
void DisabledPeriodic() override;
Expand Down
Loading

0 comments on commit 1c0323e

Please sign in to comment.