Skip to content

Commit

Permalink
add macos publish and test in circleci config (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
6fj authored Dec 2, 2022
1 parent 74f0fb7 commit 0d47bb8
Showing 1 changed file with 76 additions and 8 deletions.
84 changes: 76 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parameters:
# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
ut:
linux_ut:
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
docker:
Expand All @@ -29,11 +29,75 @@ jobs:
steps:
- checkout
- run:
name: "bazel test"
name: "test"
command: "bazel test //spu/... --ui_event_filters=-info,-debug,-warning --jobs=8 --test_timeout=1800 --test_output=errors"
- store_test_results:
path: ./bazel-testlogs
test_pypi_publish:
macOS_ut:
macos:
xcode: 13.0.0
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
resource_class: large
steps:
- checkout
- run:
name: "test"
command: |
set -ex
brew install bazel cmake ninja nasm libomp wget
(cd "/usr/local/Cellar/bazel/4.2.1/libexec/bin" && curl -fLO https://releases.bazel.build/5.1.1/release/bazel-5.1.1-darwin-x86_64 && chmod +x bazel-5.1.1-darwin-x86_64)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate
conda init zsh
conda create -y -n secretflow python=3.8
conda activate secretflow
conda install -y grpcio
pip install -r requirements.txt
bazel test //spu/... --ui_event_filters=-info,-debug,-warning --jobs=8 --test_timeout=1800 --test_output=errors
macOS_publish:
macos:
xcode: 13.0.0
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
resource_class: large
steps:
- checkout
- run:
name: "test"
command: |
set -ex
brew install bazel cmake ninja nasm libomp wget
(cd "/usr/local/Cellar/bazel/4.2.1/libexec/bin" && curl -fLO https://releases.bazel.build/5.1.1/release/bazel-5.1.1-darwin-x86_64 && chmod +x bazel-5.1.1-darwin-x86_64)
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
source $HOME/miniconda/bin/activate
conda init zsh
conda create -y -n secretflow python=3.8
conda activate secretflow
conda install -y grpcio
pip install -r requirements.txt
env BAZEL_MAX_JOBS=8 sh ./build_wheel_entrypoint.sh
spu_wheel_name=$(<./spu_wheel.name)
spu_wheel_path="./${spu_wheel_name//sf-spu/sf_spu}"
python3 -m pip install twine
python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} $spu_wheel_path
linux_publish:
docker:
- image: registry.hub.docker.com/secretflow/secretflow-gcc11-centos7-release:0.1
resource_class: xlarge
Expand All @@ -47,16 +111,20 @@ jobs:
spu_wheel_name=$(<./spu_wheel.name)
spu_wheel_path="./${spu_wheel_name//sf-spu/sf_spu}"
python3 -m pip install twine
python3 -m twine upload -r testpypi -u __token__ -p ${TEST_PYPI_TWINE_TOKEN} $spu_wheel_path
python3 -m twine upload -r pypi -u __token__ -p ${PYPI_TWINE_TOKEN} $spu_wheel_path
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
default:
ut:
jobs:
- linux_ut
linux_publish:
when: << pipeline.parameters.GHA_Action >>
jobs:
- ut
publish:
- linux_publish
macOS_publish:
when: << pipeline.parameters.GHA_Action >>
jobs:
- test_pypi_publish
- macOS_publish

0 comments on commit 0d47bb8

Please sign in to comment.