diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..9c87164ae3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,164 @@ +name: CI + +on: [pull_request, push] + +jobs: + build-docker: + strategy: + fail-fast: false + matrix: + include: + - container: wpilib/roborio-cross-ubuntu:2020-18.04 + artifact-name: Athena + build-options: "-Ponlylinuxathena" + - container: wpilib/raspbian-cross-ubuntu:10-18.04 + artifact-name: Raspbian + build-options: "-Ponlylinuxraspbian" + - container: wpilib/aarch64-cross-ubuntu:bionic-18.04 + artifact-name: Aarch64 + build-options: "-Ponlylinuxaarch64bionic" + - container: wpilib/ubuntu-base:18.04 + artifact-name: Linux + build-options: "" + name: "Build - ${{ matrix.artifact-name }}" + runs-on: ubuntu-latest + container: ${{ matrix.container }} + steps: + - uses: actions/checkout@v2 + - name: Fetch all history and metadata + run: git fetch --prune --unshallow + - name: Build with Gradle + run: ./gradlew build -PbuildServer ${{ matrix.build-options }} + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact-name }} + path: build/allOutputs + + build-host: + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + artifact-name: Win64 + architecture: x64 + - os: windows-latest + artifact-name: Win32 + architecture: x86 + - os: macos-latest + artifact-name: macOS + architecture: x64 + name: "Build - ${{ matrix.artifact-name }}" + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Fetch all history and metadata + run: git fetch --prune --unshallow + - uses: actions/setup-java@v1 + with: + java-version: 11 + architecture: ${{ matrix.architecture }} + - name: Build with Gradle + run: ./gradlew build -PbuildServer + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact-name }} + path: build/allOutputs + + build-cmake: + name: "Build - CMake" + runs-on: ubuntu-latest + container: wpilib/roborio-cross-ubuntu:2020-18.04 + steps: + - uses: actions/checkout@v2 + - name: configure + run: mkdir build && cd build && cmake -DWITHOUT_ALLWPILIB=OFF .. + - name: build + run: cd build && make -j3 + + build-cmake-windows: + name: "Build - CMake Windows" + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Prepare vcpkg + uses: lukka/run-vcpkg@v2 + with: + vcpkgArguments: opencv + vcpkgDirectory: ${{ runner.workspace }}/vcpkg/ + vcpkgGitCommitId: 544f8e4593764f78faa94bac2adb81cca5232943 + vcpkgTriplet: x64-windows + - name: Configure & Build + uses: lukka/run-cmake@v2 + with: + buildDirectory: ${{ runner.workspace }}/build/ + cmakeAppendedArgs: -DWITHOUT_JAVA=ON -DWITHOUT_ALLWPILIB=OFF -DWITHOUT_CSCORE=OFF + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + useVcpkgToolchainFile: true + + wpiformat: + name: "wpiformat" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch all history and metadata + run: | + git fetch --prune --unshallow + git checkout -b pr + git branch -f master origin/master + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install clang-format + run: sudo apt-get update -q && sudo apt-get install clang-format-10 + - name: Install wpiformat + run: pip3 install wpiformat + - name: Run + run: wpiformat -clang 10 + - name: Check Output + run: git --no-pager diff --exit-code HEAD + + combine: + name: Combine + needs: [build-docker, build-host] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + repository: wpilibsuite/build-tools + - uses: actions/download-artifact@v2 + with: + path: combiner/products/build/allOutputs + - name: Flatten Artifacts + run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/ + - uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Combine + if: | + !startsWith(github.ref, 'refs/tags/v') && + github.ref != 'refs/heads/master' + run: cd combiner && ./gradlew publish -Pallwpilib + - name: Combine (Master) + if: | + github.repository_owner == 'wpilibsuite' && + github.ref == 'refs/heads/master' + run: cd combiner && ./gradlew publish -Pallwpilib + env: + RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE' + ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + - name: Combine (Release) + if: | + github.repository_owner == 'wpilibsuite' && + startsWith(github.ref, 'refs/tags/v') + run: cd combiner && ./gradlew publish -Pallwpilib -PreleaseRepoPublish + env: + RUN_AZURE_ARTIFACTORY_RELEASE: 'TRUE' + ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + - uses: actions/upload-artifact@v2 + with: + name: Maven + path: ~/releases diff --git a/README.md b/README.md index 96c8cbbcf7..04bf6f0b79 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # WPILib Project +![CI](https://github.com/wpilibsuite/allwpilib/workflows/CI/badge.svg) [![Build Status](https://dev.azure.com/wpilib/wpilib/_apis/build/status/wpilibsuite.allwpilib)](https://dev.azure.com/wpilib/wpilib/_build/latest?definitionId=1) Welcome to the WPILib project. This repository contains the HAL, WPILibJ, and WPILibC projects. These are the core libraries for creating robot programs for the roboRIO.