mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
This sets the workflow concurrency to 1 for all workflows. For PRs this means if you push an additional commit older jobs will be cancelled. The documentation workflow already only runs on tags or merges to main. For this, we cancel previous runs if they are to the same destination (tag or main) but still prevent 2 jobs from running at once if they are spawned from different refs.
70 lines
2.0 KiB
YAML
70 lines
2.0 KiB
YAML
name: CMake
|
|
|
|
on: [pull_request, push]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
name: Linux
|
|
container: wpilib/roborio-cross-ubuntu:2022-20.04
|
|
flags: ""
|
|
- os: macOS-11
|
|
name: macOS
|
|
container: ""
|
|
flags: "-DWITH_JAVA=OFF"
|
|
name: "Build - ${{ matrix.name }}"
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{ matrix.container }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install Dependencies
|
|
run: |
|
|
if [ "$RUNNER_OS" == "macOS" ]; then
|
|
brew install opencv
|
|
fi
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install jinja
|
|
run: python -m pip install jinja2
|
|
- name: configure
|
|
run: mkdir build && cd build && cmake ${{ matrix.flags }} ..
|
|
- name: build
|
|
working-directory: build
|
|
run: cmake --build . -j$(nproc)
|
|
- name: test
|
|
working-directory: build
|
|
run: ctest --output-on-failure
|
|
|
|
build-vcpkg:
|
|
name: "Build - Windows"
|
|
runs-on: windows-2019
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Prepare vcpkg
|
|
uses: lukka/run-vcpkg@v7
|
|
with:
|
|
vcpkgArguments: opencv
|
|
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
|
|
vcpkgTriplet: x64-windows
|
|
vcpkgGitCommitId: d781bd9ca77ac3dc2f13d88169021d48459c665f # HEAD on 2021-07-25
|
|
- name: Configure & Build
|
|
uses: lukka/run-cmake@v3
|
|
with:
|
|
buildDirectory: ${{ runner.workspace }}/build
|
|
cmakeAppendedArgs: -DWITH_JAVA=OFF
|
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
|
useVcpkgToolchainFile: true
|
|
- name: Run Tests
|
|
run: ctest -C "Debug" --output-on-failure
|
|
working-directory: ${{ runner.workspace }}/build
|