[ci] Upgrade to new macOS runner (#6328)

This commit is contained in:
Tyler Veness
2024-02-04 10:38:23 -08:00
committed by GitHub
parent d4533a8900
commit 3b2a2381b6
7 changed files with 26 additions and 18 deletions

View File

@@ -16,11 +16,11 @@ jobs:
name: Linux
container: wpilib/roborio-cross-ubuntu:2024-22.04
flags: "-DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
- os: macOS-12
- os: macOS-14
name: macOS
container: ""
env: "PATH=\"/usr/local/opt/protobuf@3/bin:$PATH\""
flags: "-DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DCMAKE_LIBRARY_PATH=/usr/local/opt/protobuf@3/lib -DProtobuf_INCLUDE_DIR=/usr/local/opt/protobuf@3/include -DProtobuf_PROTOC_EXECUTABLE=/usr/local/opt/protobuf@3/bin/protoc"
env: "PATH=\"/opt/homebrew/opt/protobuf@3/bin:$PATH\""
flags: "-DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DCMAKE_LIBRARY_PATH=/opt/homebrew/opt/protobuf@3/lib -DProtobuf_INCLUDE_DIR=/opt/homebrew/opt/protobuf@3/include -DProtobuf_PROTOC_EXECUTABLE=/opt/homebrew/opt/protobuf@3/bin/protoc"
name: "Build - ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
@@ -34,15 +34,15 @@ jobs:
if: runner.os == 'Linux'
run: wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf_1.3.3_amd64.deb && sudo apt install ./protoc-gen-quickbuf_1.3.3_amd64.deb
- name: Install opencv (macOS)
- name: Install dependencies (macOS)
run: brew install opencv protobuf@3 ninja
if: runner.os == 'macOS'
- name: Set up Python 3.8 (macOS)
- name: Set up Python 3.10 (macOS)
if: runner.os == 'macOS'
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

View File

@@ -33,10 +33,10 @@ jobs:
env:
GITHUB_TOKEN: "${{ secrets.COMMENT_COMMAND_PAT_TOKEN }}"
NUMBER: ${{ github.event.issue.number }}
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Setup Java
uses: actions/setup-java@v4
with:

View File

@@ -94,9 +94,9 @@ jobs:
task: "copyAllOutputs"
outputs: "build/allOutputs"
build-dir: "c:\\work"
- os: macOS-12
- os: macOS-14
artifact-name: macOS
architecture: x64
architecture: aarch64
task: "build"
outputs: "build/allOutputs"
build-dir: "."

View File

@@ -22,10 +22,10 @@ jobs:
run: |
git checkout -b pr
git branch -f main origin/main
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat==2023.36
- name: Run
@@ -61,10 +61,10 @@ jobs:
git config --global --add safe.directory /__w/allwpilib/allwpilib
git checkout -b pr
git branch -f main origin/main
- name: Set up Python 3.8
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat
- name: Create compile_commands.json

View File

@@ -135,7 +135,11 @@ std::vector<UsbCameraInfo> EnumerateUsbCameras(CS_Status* status) {
std::vector<UsbCameraInfo> retval;
NSArray<AVCaptureDeviceType>* deviceTypes = @[
AVCaptureDeviceTypeBuiltInWideAngleCamera,
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 140000
AVCaptureDeviceTypeExternal
#else
AVCaptureDeviceTypeExternalUnknown
#endif
];
AVCaptureDeviceDiscoverySession* session = [AVCaptureDeviceDiscoverySession
discoverySessionWithDeviceTypes:deviceTypes

View File

@@ -76,7 +76,11 @@ using namespace cs;
if ([device.deviceType
isEqualToString:AVCaptureDeviceTypeBuiltInWideAngleCamera] ||
[device.deviceType
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 140000
isEqualToString:AVCaptureDeviceTypeExternal]) {
#else
isEqualToString:AVCaptureDeviceTypeExternalUnknown]) {
#endif
self.notifier->NotifyUsbCamerasChanged();
}
});

View File

@@ -14,8 +14,8 @@ TEST(OLSTest, TwoVariablesTwoPoints) {
auto [coeffs, rSquared, rmse] = sysid::OLS(X, y);
EXPECT_EQ(coeffs.size(), 2u);
EXPECT_DOUBLE_EQ(coeffs[0], 1.0);
EXPECT_DOUBLE_EQ(coeffs[1], 2.0);
EXPECT_NEAR(coeffs[0], 1.0, 1e-12);
EXPECT_NEAR(coeffs[1], 2.0, 1e-12);
EXPECT_DOUBLE_EQ(rSquared, 1.0);
}
@@ -28,8 +28,8 @@ TEST(OLSTest, TwoVariablesFivePoints) {
auto [coeffs, rSquared, rmse] = sysid::OLS(X, y);
EXPECT_EQ(coeffs.size(), 2u);
EXPECT_DOUBLE_EQ(coeffs[0], 0.30487804878048774);
EXPECT_DOUBLE_EQ(coeffs[1], 1.5182926829268293);
EXPECT_NEAR(coeffs[0], 0.30487804878048774, 1e-12);
EXPECT_NEAR(coeffs[1], 1.5182926829268293, 1e-12);
EXPECT_DOUBLE_EQ(rSquared, 0.91906029466386019);
}