Add steps for using a custom build in robot project (NFC) #538
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: temurin | |
- name: Publish to Maven Local | |
run: ./gradlew build publishToMavenLocal --stacktrace -PlocalPublish | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Maven | |
path: ~/.m2/ | |
test_examples: | |
needs: build | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
language: [cpp, java] #, jni, kotlin] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: temurin | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Maven | |
path: ~/.m2/ | |
- name: Setup RoboRIO Toolchain | |
if: ${{ (matrix.language == 'cpp') || (matrix.language == 'jni') }} | |
run: ./gradlew installRoboRioToolchain | |
working-directory: testing/${{ matrix.language }} | |
- name: Test ${{ matrix.language }} Build | |
run: ./gradlew build | |
working-directory: testing/${{ matrix.language }} | |
publish: | |
needs: [build, test_examples] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: temurin | |
- name: Publish | |
if: ${{ github.repository_owner == 'wpilibsuite' && startsWith(github.ref, 'refs/tags/v') }} | |
env: | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
run: | | |
./gradlew publishPlugin \ | |
-Pgradle.publish.key=$GRADLE_PUBLISH_KEY \ | |
-Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET |