Add CI (#11)
This commit is contained in:
parent
6e9cde97e7
commit
1307c38642
109
.github/workflows/ci.yml
vendored
Normal file
109
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-docker:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- container: wpilib/roborio-cross-ubuntu:2023-22.04
|
||||||
|
artifact-name: Athena
|
||||||
|
build-options: "-Ponlylinuxathena"
|
||||||
|
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
|
||||||
|
artifact-name: Arm32
|
||||||
|
build-options: "-Ponlylinuxarm32"
|
||||||
|
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
|
||||||
|
artifact-name: Arm64
|
||||||
|
build-options: "-Ponlylinuxarm64"
|
||||||
|
- container: wpilib/ubuntu-base:22.04
|
||||||
|
artifact-name: Linux
|
||||||
|
build-options: ""
|
||||||
|
name: "Build - ${{ matrix.artifact-name }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Fetch all history and metadata
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory /__w/vendor-template/vendor-template
|
||||||
|
git fetch --prune --unshallow
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew build --max-workers 1 ${{ 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-2019
|
||||||
|
artifact-name: Win64
|
||||||
|
architecture: x64
|
||||||
|
- os: windows-2019
|
||||||
|
artifact-name: Win32
|
||||||
|
architecture: x86
|
||||||
|
- os: macos-11
|
||||||
|
artifact-name: macOS
|
||||||
|
architecture: x64
|
||||||
|
name: "Build - ${{ matrix.artifact-name }}"
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- 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 -Pbuildalldesktop
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.artifact-name }}
|
||||||
|
path: build/allOutputs
|
||||||
|
|
||||||
|
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')
|
||||||
|
run: ./gradlew publish -Pthirdparty
|
||||||
|
working-directory: combiner
|
||||||
|
- name: Combine (Release)
|
||||||
|
if: |
|
||||||
|
github.repository_owner == 'wpilibsuite' &&
|
||||||
|
startsWith(github.ref, 'refs/tags/v')
|
||||||
|
run: |
|
||||||
|
./gradlew publish -Pthirdparty
|
||||||
|
working-directory: combiner
|
||||||
|
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
|
Loading…
Reference in New Issue
Block a user