Skip to content

Commit

Permalink
Merge pull request #19 from OakvilleDynamics/chore/update-gradle-action
Browse files Browse the repository at this point in the history
Update Gradle Action, create unit tests
  • Loading branch information
garrettsummerfi3ld committed Feb 21, 2024
2 parents 8006eaa + 8ebf472 commit fde7388
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a basic workflow to build robot code.
name: Build
name: Continuous Integration

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch.
Expand All @@ -15,8 +15,9 @@ concurrency:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
# This job will build the robot code
build:
name: Build
# The type of runner that the job will run on
runs-on: ubuntu-latest

Expand All @@ -34,12 +35,34 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
uses: gradle/actions/setup-gradle@v3

# Runs a single command using the runners shell
- name: Compile and run tests on robot code
run: ./gradlew build
run: ./gradlew build

# This job will run through tests on the robot code
test:
name: Test
# 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@v4

# 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

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

# Runs a single command using the runners shell
- name: Run tests on robot code
run: ./gradlew test
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
- uses: actions/checkout@v4

# Runs an action from the Gradle org to validate the Gradle wrapper, see
# https://github.com/gradle/wrapper-validation-action/tree/v1/?tab=readme-ov-file#the-gradle-wrapper-problem-in-open-source
# https://github.com/gradle/wrapper-validation-action?tab=readme-ov-file#the-gradle-wrapper-problem-in-open-source
# for more details as to why this is important.
- uses: gradle/wrapper-validation-action@v2
6 changes: 1 addition & 5 deletions .github/workflows/syntax-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v3

# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
uses: gradle/actions/setup-gradle@v3

# Runs our formatter for easier code review
- name: Run spotlessApply
Expand Down
8 changes: 8 additions & 0 deletions src/test/com/oakvillerobotics/frc2024/RobotContainerTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.oakvillerobotics.frc2024;

public class RobotContainerTest {
@test
public void createRobotContainer() {
new RobotContainer();
}
}

0 comments on commit fde7388

Please sign in to comment.