diff --git a/.github/workflows/admin-orchestrator.yaml b/.github/workflows/admin-orchestrator.yaml index d42745e..eb34da2 100644 --- a/.github/workflows/admin-orchestrator.yaml +++ b/.github/workflows/admin-orchestrator.yaml @@ -2,11 +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: @@ -59,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 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..c83fbb6 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + 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 + 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 + + - name: Build robot code + 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/.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/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')