Skip to content

Commit

Permalink
Merge branch 'main' into fixs-bc-i-fucked-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan1522 authored Sep 12, 2024
2 parents 39f59fa + 6ff56e3 commit 982a488
Show file tree
Hide file tree
Showing 55 changed files with 32,898 additions and 17,374 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,43 @@ on:

jobs:
build:
name: Build
name: Compile Java
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Add repository to git safe directories
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Grant execute permission
- uses: actions/checkout@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build robot code
run: ./gradlew build
- name: Compile robot code
run: ./gradlew compileJava

test:
name: "Test Java"
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2024-22.04
steps:
- uses: actions/checkout@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run tests on robot code
run: ./gradlew test -PrunTests

format:
name: "Check Format Java"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Fetch all history and metadata
run: |
git checkout -b pr
git branch -f main origin/main
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Run formatter
run: ./gradlew spotlessCheck
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

76 changes: 40 additions & 36 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,44 @@ tasks.withType(JavaCompile) {
// Spotless formatting
project.compileJava.dependsOn(spotlessApply)
spotless {
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**'
}
toggleOffOn()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**'
}
eclipseWtp('xml')
trimTrailingWhitespace()
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
}
trimTrailingWhitespace()
endWithNewline()
}
java {
target fileTree('.') {
include '**/*.java'
exclude '**/build/**', '**/build-*/**'
}
toggleOffOn()
googleJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
groovyGradle {
target fileTree('.') {
include '**/*.gradle'
exclude '**/build/**', '**/build-*/**'
}
greclipse()
indentWithSpaces(4)
trimTrailingWhitespace()
endWithNewline()
}
format 'xml', {
target fileTree('.') {
include '**/*.xml'
exclude '**/build/**', '**/build-*/**'
}
eclipseWtp('xml')
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
format 'misc', {
target fileTree('.') {
include '**/*.md', '**/.gitignore'
exclude '**/build/**', '**/build-*/**'
}
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
}
Loading

0 comments on commit 982a488

Please sign in to comment.