-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Add CI for MacOS (x64 and aarch64) #35
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Run cargo build | ||
shell: bash | ||
run: | | ||
cd core | ||
cargo build | ||
- name: Cache Maven dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Run Maven compile | ||
shell: bash | ||
run: | | ||
./mvnw compile test-compile scalafix:scalafix -Psemanticdb | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
SPARK_HOME=`pwd` ./mvnw clean install |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Check cargo fmt | ||
shell: bash | ||
run: | | ||
cd core | ||
cargo fmt --all -- --check --color=never | ||
|
||
- name: Check cargo clippy | ||
shell: bash | ||
run: | | ||
cd core | ||
cargo clippy --color=never -- -D warnings | ||
|
||
- name: Check compilation | ||
shell: bash | ||
run: | | ||
cd core | ||
cargo check --benches | ||
|
||
- name: Cache Maven dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
|
||
- name: Build common module (pre-requisite for Rust tests) | ||
shell: bash | ||
run: | | ||
cd common | ||
../mvnw clean compile -DskipTests | ||
|
||
- name: Run cargo test | ||
shell: bash | ||
run: | | ||
cd core | ||
# This is required to run some JNI related tests on the Rust side | ||
RUST_BACKTRACE=1 \ | ||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JAVA_HOME/lib:$JAVA_HOME/lib/server:$JAVA_HOME/lib/jli \ | ||
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$JAVA_HOME/lib:$JAVA_HOME/lib/server:$JAVA_HOME/lib/jli \ | ||
cargo test | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
name: Prepare Builder for MacOS | ||
description: 'Prepare Build Environment' | ||
inputs: | ||
rust-version: | ||
description: 'version of rust to install (e.g. nightly)' | ||
required: true | ||
default: 'nightly' | ||
jdk-version: | ||
description: 'jdk version to install (e.g., 17)' | ||
required: true | ||
default: '17' | ||
architecture: | ||
description: 'OS architecture for the JDK' | ||
required: true | ||
default: 'x64' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Build Dependencies | ||
shell: bash | ||
run: | | ||
# Install protobuf | ||
mkdir -p $HOME/d/protoc | ||
cd $HOME/d/protoc | ||
export PROTO_ZIP="protoc-21.4-osx-aarch_64.zip" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm yea, I don't know how it worked for Mac There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as DataFusion experience. 😂 |
||
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v21.4/$PROTO_ZIP | ||
unzip $PROTO_ZIP | ||
echo "$HOME/d/protoc/bin" >> $GITHUB_PATH | ||
export PATH=$PATH:$HOME/d/protoc/bin | ||
|
||
- name: Install JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '17' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jdk-version? |
||
architecture: ${{inputs.architecture}} | ||
|
||
- name: Set JAVA_HOME | ||
shell: bash | ||
run: echo "JAVA_HOME=$(echo ${JAVA_HOME})" >> $GITHUB_ENV | ||
|
||
- name: Setup Rust toolchain | ||
shell: bash | ||
# rustfmt is needed for the substrait build script | ||
run: | | ||
echo "Installing ${{inputs.rust-version}}" | ||
rustup toolchain install ${{inputs.rust-version}} | ||
rustup default ${{inputs.rust-version}} | ||
rustup component add rustfmt clippy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of
inputs.jdk-version
, this is fixed to 17 now?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea I should use
inputs.java-version
here