Add CI #3
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: Build | |
on: | |
push: | |
branches: | |
- 'master' | |
tags-ignore: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ['Java', 'C++'] | |
include: | |
- example: 'Alternate Encoder' | |
- example: 'Analog Feedback Device' | |
- example: 'Arcade Drive With CAN' | |
skip-java: true | |
- example: 'Arcade Drive with PWM' | |
skip-java: true | |
- example: 'Bus Measurements' | |
- example: 'Encoder Feedback Device' | |
- example: 'Get and Set Parameters' | |
- example: 'Limit Switch' | |
- example: 'Motor Follower' | |
skip-cpp: true | |
- example: 'Position Closed Loop Control' | |
- example: 'Read Encoder Values' | |
- example: 'Smart Motion Example' | |
- example: 'Soft Limits' | |
- example: 'Tank Drive With CAN' | |
skip-cpp: true | |
- example: 'Velocity Closed Loop Control' | |
name: 'Build ${{ matrix.example }} - ${{ matrix.language }}' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache | |
uses: actions/cache@v3 | |
if: (matrix.language == 'Java' && !(matrix.skip-java == true)) || (matrix.language == 'C++' && !(matrix.skip-cpp == true)) | |
with: | |
path: | | |
${{ matrix.language }}/${{ matrix.example }}/.gradle | |
${{ matrix.language }}/${{ matrix.example }}/bin | |
${{ matrix.language }}/${{ matrix.example }}/build | |
key: ${{ matrix.example }}-${{ matrix.language }}-build-${{ github.sha }} | |
restore-keys: | | |
${{ matrix.example }}-${{ matrix.language }}-build- | |
- name: Build | |
if: (matrix.language == 'Java' && !matrix.skip-java) || (matrix.language == 'C++' && !matrix.skip-cpp) | |
run: | | |
cd ${{ matrix.language }} | |
cd ${{ matrix.example }} | |
./gradlew build |