Skip to content

Commit

Permalink
Add action to tag on allwpilib tag dispatch (#605)
Browse files Browse the repository at this point in the history
Disables export tests and updates hardcoded version prior to tagging
Renables export tests after tagged
Fixes #212
  • Loading branch information
sciencewhiz authored Jul 29, 2024
1 parent 8398c5b commit 97752c0
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 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
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

0 comments on commit 97752c0

Please sign in to comment.