Skip to content

Change robot-template to Experiment #2

Change robot-template to Experiment

Change robot-template to Experiment #2

Workflow file for this run

# 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 ]
pull_request:
branches: [ opened, synchronized, reopened ]
workflow_dispatch:
# 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"
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:2023-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
# Set the fetch-depth to get all history so blame analysis in Sonar will work.
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fix git permissions
run: git config --global --add safe.directory `pwd`
# Grant execute permission for gradlew
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Compile and run tests on robot code
run: ./gradlew build
- name: Analyze with Sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonarqube --info
# Create Java Docs
- name: Build Java Docs
run: ./gradlew javadoc
# Copy Reports
- name: Copy Report
uses: actions/upload-artifact@v3
with:
name: Reports
path: build/reports/
# Copy Docs
- name: Copy Docs
uses: actions/upload-artifact@v3
with:
name: Docs
path: build/docs