From 572f9d10b288db9c502f6b5fcdc1b629da72c9ae Mon Sep 17 00:00:00 2001 From: "Timothy P. Ellsworth Bowers" Date: Sun, 28 Dec 2025 17:39:20 -0700 Subject: [PATCH 1/4] Clean up CI with caching and directed jobs deleted: .github/workflows/build.yml new file: .github/workflows/ci.yaml deleted: .github/workflows/main.yml new file: gradle.properties --- .github/workflows/build.yml | 18 ------------- .github/workflows/ci.yaml | 40 +++++++++++++++++++++++++++ .github/workflows/main.yml | 54 ------------------------------------- gradle.properties | 18 +++++++++++++ 4 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/main.yml create mode 100644 gradle.properties diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 8e92b75..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Build - -on: - push: - pull_request: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - container: wpilib/roborio-cross-ubuntu:2024-22.04 - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - name: Grant execute permission - run: chmod +x gradlew - - name: Build robot code - run: ./gradlew build diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..aca6f42 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + container: wpilib/roborio-cross-ubuntu:2024-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Mark repo as safe for git + run: git config --global --add safe.directory $GITHUB_WORKSPACE + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Set up Gradle cache + uses: gradle/actions/setup-gradle@v4 + + # ------------------------------------------------------------ + # Always build (all branches, all PRs) + # ------------------------------------------------------------ + - name: Build robot code + run: ./gradlew build + + # ------------------------------------------------------------ + # Spotless only on main/develop + # ------------------------------------------------------------ + - name: Run Spotless checks + if: | + github.ref == 'refs/heads/main' || + github.ref == 'refs/heads/develop' || + github.base_ref == 'main' || + github.base_ref == 'develop' + run: ./gradlew spotlessCheck diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 45964cf..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,54 +0,0 @@ -# This is a basic workflow to build robot code. - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the main branch. -on: - push: - branches: [ main, develop ] - pull_request: - branches: [ main, develop ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a job called "build" which is the main build - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # This grabs the WPILib docker container - container: wpilib/roborio-cross-ubuntu:2024-22.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v6 - - # Declares the repository safe and not under dubious ownership. - - name: Add repository to git safe directories - run: git config --global --add safe.directory $GITHUB_WORKSPACE - - # Grant execute permission for gradlew - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - # Runs a single command using the runners shell - - name: Compile and run tests on robot code - run: ./gradlew build - - # This workflow contains a job called "build" which is the main build - spotless: - # The type of runner that the job will run on - runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - uses: actions/setup-java@v5 - with: - distribution: 'zulu' - java-version: 17 - - run: ./gradlew spotlessCheck \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..cd9de7c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,18 @@ +# ------------------------------------------------------------ +# Gradle performance & CI tuning +# ------------------------------------------------------------ + +# CI should not use the Gradle daemon +org.gradle.daemon=false + +# Enable parallel task execution +org.gradle.parallel=true + +# Enable build cache +org.gradle.caching=true + +# Reduce configuration time for multi-project builds +org.gradle.configureondemand=true + +# Keep console output readable in CI +org.gradle.console=plain From efa957bdb4607157f9e26a05094c6698428b9beb Mon Sep 17 00:00:00 2001 From: "Timothy P. Ellsworth Bowers" Date: Sun, 28 Dec 2025 18:04:52 -0700 Subject: [PATCH 2/4] Do not run admin-orchestrator on pushes to all branches modified: .github/workflows/admin-orchestrator.yaml --- .github/workflows/admin-orchestrator.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/admin-orchestrator.yaml b/.github/workflows/admin-orchestrator.yaml index d42745e..265ae23 100644 --- a/.github/workflows/admin-orchestrator.yaml +++ b/.github/workflows/admin-orchestrator.yaml @@ -2,9 +2,6 @@ name: Admin branch orchestration on: create: - push: - branches: - - "**" schedule: - cron: "0 3 * * 1" # Weekly, Monday 03:00 UTC workflow_dispatch: From a2e0fab669b3ab2d443f21f25106b0d0dc2cc7e0 Mon Sep 17 00:00:00 2001 From: "Timothy P. Ellsworth Bowers" Date: Sun, 28 Dec 2025 18:14:55 -0700 Subject: [PATCH 3/4] Enforce CI gradle settings only for CI environment modified: .github/workflows/ci.yaml modified: .github/workflows/dependency-submission.yml deleted: gradle.properties modified: settings.gradle --- .github/workflows/ci.yaml | 41 +++++++++++++-------- .github/workflows/dependency-submission.yml | 4 ++ gradle.properties | 18 --------- settings.gradle | 2 +- 4 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 gradle.properties diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aca6f42..c83fbb6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,9 +5,13 @@ on: pull_request: jobs: + # ------------------------------------------------------------ + # Main build job + # ------------------------------------------------------------ build: runs-on: ubuntu-latest container: wpilib/roborio-cross-ubuntu:2024-22.04 + if: ${{ github.event_name != 'pull_request' || github.event.pull_request == null }} steps: - name: Checkout repository @@ -22,19 +26,26 @@ jobs: - name: Set up Gradle cache uses: gradle/actions/setup-gradle@v4 - # ------------------------------------------------------------ - # Always build (all branches, all PRs) - # ------------------------------------------------------------ - name: Build robot code - run: ./gradlew build - - # ------------------------------------------------------------ - # Spotless only on main/develop - # ------------------------------------------------------------ - - name: Run Spotless checks - if: | - github.ref == 'refs/heads/main' || - github.ref == 'refs/heads/develop' || - github.base_ref == 'main' || - github.base_ref == 'develop' - run: ./gradlew spotlessCheck + run: ./gradlew build --no-daemon --parallel --build-cache + + # ------------------------------------------------------------ + # Spotless job (separate for branch protection) + # ------------------------------------------------------------ + spotless: + runs-on: ubuntu-latest + container: wpilib/roborio-cross-ubuntu:2024-22.04 + # Only run for PRs or pushes targeting main/develop + if: github.base_ref == 'main' || github.base_ref == 'develop' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Set up Gradle cache + uses: gradle/actions/setup-gradle@v4 + + - name: Run Spotless check + run: ./gradlew spotlessCheck --no-daemon --parallel --build-cache diff --git a/.github/workflows/dependency-submission.yml b/.github/workflows/dependency-submission.yml index 7a7c477..16d9455 100644 --- a/.github/workflows/dependency-submission.yml +++ b/.github/workflows/dependency-submission.yml @@ -1,5 +1,9 @@ name: Dependency Submission +# Purpose: Generate and submit Gradle dependency metadata (graph) to Gradle’s services. +# Trigger: Push to main branch only. +# Effect: Helps with dependency insight, conflict detection, and build analytics. + on: push: branches: [ 'main' ] diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index cd9de7c..0000000 --- a/gradle.properties +++ /dev/null @@ -1,18 +0,0 @@ -# ------------------------------------------------------------ -# Gradle performance & CI tuning -# ------------------------------------------------------------ - -# CI should not use the Gradle daemon -org.gradle.daemon=false - -# Enable parallel task execution -org.gradle.parallel=true - -# Enable build cache -org.gradle.caching=true - -# Reduce configuration time for multi-project builds -org.gradle.configureondemand=true - -# Keep console output readable in CI -org.gradle.console=plain diff --git a/settings.gradle b/settings.gradle index 969c7b0..0441686 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,7 +4,7 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - String frcYear = '2025' + String frcYear = '2026beta' File frcHome if (OperatingSystem.current().isWindows()) { String publicFolder = System.getenv('PUBLIC') From 19790f0dbfac31c7160c9f630b60999ca3e1c952 Mon Sep 17 00:00:00 2001 From: "Timothy P. Ellsworth Bowers" Date: Sun, 28 Dec 2025 19:11:54 -0700 Subject: [PATCH 4/4] Run admin-orchestrator on pushes to main modified: .github/workflows/admin-orchestrator.yaml --- .github/workflows/admin-orchestrator.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/admin-orchestrator.yaml b/.github/workflows/admin-orchestrator.yaml index 265ae23..eb34da2 100644 --- a/.github/workflows/admin-orchestrator.yaml +++ b/.github/workflows/admin-orchestrator.yaml @@ -2,8 +2,14 @@ name: Admin branch orchestration on: create: + + push: + branches: + - "main" + schedule: - cron: "0 3 * * 1" # Weekly, Monday 03:00 UTC + workflow_dispatch: pull_request: @@ -56,8 +62,12 @@ jobs: # Periodically rebase admin onto default (true rebase) # ------------------------------------------------------------ - name: Rebase admin onto default - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' run: | + set -e + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git fetch origin git checkout admin