generated from wpilibsuite/vendor-template
-
Notifications
You must be signed in to change notification settings - Fork 3
152 lines (148 loc) · 5.55 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: CI
on: [push, pull_request]
jobs:
build-docker:
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
artifact-name: Athena
build-options: "-Ponlylinuxathena"
platform: linuxathena
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
artifact-name: Arm32
build-options: "-Ponlylinuxarm32"
platform: linuxarm32
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
artifact-name: Arm64
build-options: "-Ponlylinuxarm64"
platform: linuxarm64
- container: wpilib/ubuntu-base:22.04
artifact-name: Linux
build-options: ""
platform: "linuxx86-64"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Fetch all history and metadata
run: |
git config --global --add safe.directory /__w/libgrapplefrc/libgrapplefrc
git fetch --prune --unshallow
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Rust Toolchain (Athena)
run: rustup target add arm-unknown-linux-gnueabi
- name: Setup Rust Toolchain (Arm32)
run: rustup target add arm-unknown-linux-gnueabihf
- name: Setup Rust Toolchain (Arm64)
run: rustup target add aarch64-unknown-linux-gnu
- name: Install Clang
run: apt-get update && apt-get install -y libclang1-15 clang llvm gcc-multilib
- name: Prepare Rust Libs
run: ./gradlew updateRustLibs --max-workers 1 ${{ matrix.build-options }}
- name: Build Rust
run: cd grapplefrcdriver && python3 build.py ${{ matrix.platform }}
- name: Build with Gradle
run: ./gradlew -D maven.repo.local=/__w/libgrapplefrc/libgrapplefrc/build/maven publishToMavenLocal -PreleaseMode --max-workers 1 ${{ matrix.build-options }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: /__w/libgrapplefrc/libgrapplefrc/build/maven
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}-Driver
path: grapplefrcdriver/target/zips
build-host:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
artifact-name: Win64
architecture: x64
platform: windowsx86-64
build-options: ""
- os: macos-12
artifact-name: macOS
architecture: x64
platform: osxuniversal
build-options: ""
- os: windows-2022
artifact-name: WinArm64
architecture: x64
platform: windowsarm64
build-options: "-Pbuildwinarm64 -Ponlywindowsarm64"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Fetch all history and metadata
run: git fetch --prune --unshallow
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
architecture: ${{ matrix.architecture }}
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Setup Rust Toolchain (macOS Arm64)
run: rustup target add aarch64-apple-darwin
if: matrix.artifact-name == 'macOS'
- name: Setup Rust Toolchain (Windows Arm64)
run: rustup target add aarch64-pc-windows-msvc
if: matrix.artifact-name == 'WinArm64'
- name: Prepare Rust Libs
run: ./gradlew updateRustLibs --max-workers 1
- name: Build Rust
run: cd grapplefrcdriver && python3 build.py ${{ matrix.platform }}
- name: Build with Gradle
run: ./gradlew publishToMavenLocal -PreleaseMode ${{ matrix.build-options }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: ~/.m2/repository
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}-Driver
path: grapplefrcdriver/target/zips
combine:
name: Combine
needs: [build-docker, build-host]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
with:
path: combiner/products/m2
- name: Flatten Artifacts
run: rsync -a --delete combiner/products/m2/*/* combiner/products/out/
- uses: actions/upload-artifact@v3
with:
name: Maven
path: combiner/products/out/
- uses: 'google-github-actions/auth@v2'
if: github.repository_owner == 'GrappleRobotics' && startsWith(github.ref, 'refs/tags/v')
with:
project_id: "grapple-frc"
credentials_json: ${{ secrets.GCP_SVC_ACCT }}
- uses: 'google-github-actions/upload-cloud-storage@v1'
if: github.repository_owner == 'GrappleRobotics' && startsWith(github.ref, 'refs/tags/v')
with:
path: "combiner/products/out/"
destination: "grapple-frc-maven"
parent: false
- uses: 'google-github-actions/upload-cloud-storage@v1'
if: github.repository_owner == 'GrappleRobotics' && startsWith(github.ref, 'refs/tags/v')
with:
path: "depjson"
destination: "grapple-frc-maven"
parent: false