Skip to content

Commit

Permalink
[ci] Upgrade to new macOS runner (wpilibsuite#6328)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Feb 4, 2024
1 parent d4533a8 commit 3b2a238
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 18 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/comment-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "."
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions cscore/src/main/native/objcpp/UsbCameraImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ CS_Source CreateUsbCameraPath(std::string_view name, std::string_view path,
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
Expand Down
4 changes: 4 additions & 0 deletions cscore/src/main/native/objcpp/UsbCameraListener.mm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ - (void)camerasChanged:(NSNotification*)notification {
if ([device.deviceType
isEqualToString:AVCaptureDeviceTypeBuiltInWideAngleCamera] ||
[device.deviceType
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 140000
isEqualToString:AVCaptureDeviceTypeExternal]) {
#else
isEqualToString:AVCaptureDeviceTypeExternalUnknown]) {
#endif
self.notifier->NotifyUsbCamerasChanged();
}
});
Expand Down
8 changes: 4 additions & 4 deletions sysid/src/test/native/cpp/analysis/OLSTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 3b2a238

Please sign in to comment.