Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Update Gradle Action, create unit tests #19

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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();
}
}
Loading