Skip to content

Commit

Permalink
Merge pull request #1 from secretflow/main
Browse files Browse the repository at this point in the history
circleci 修复 (#314)
  • Loading branch information
UniqueMarvin authored Jun 7, 2024
2 parents 7010ef9 + 3241584 commit 0050592
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 50 deletions.
72 changes: 35 additions & 37 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,58 +37,50 @@ executors:
shell: /bin/bash --login -eo pipefail

commands:
test:
go_env:
steps:
- checkout
- setup_remote_docker
- run:
name: "install go"
command: |
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64";;
aarch64) ARCH="arm64";;
*) echo "Unsupported architecture"; exit 1;;
esac
if [ "$ARCH" == "aarch64" ]; then
ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
ln -sf /usr/bin/bash /bin/sh
yum update -y
yum install -y wget make cmake git curl unzip gcc perl-IPC-Cmd
GOLANG_DIR="/usr/local"
GOLANG_VERSION="1.19.7"
GOLANG_URL="https://golang.org/dl/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
GOLANG_URL="https://golang.google.cn/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz"
if ! command -v go &> /dev/null; then
wget "$GOLANG_URL"
tar -C "$GOLANG_DIR" -xzf "go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a ~/.bashrc
echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
source ~/.bashrc
tar -C "$GOLANG_DIR" -xzf "go${GOLANG_VERSION}.linux-arm64.tar.gz"
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' | tee -a ~/.bashrc
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $BASH_ENV
fi
fi
test:
steps:
- checkout
- setup_remote_docker
- run:
name: "Install the go module"
command: |
go install google.golang.org/protobuf/cmd/[email protected]
go install github.com/t-yuki/gocover-cobertura@latest
go install github.com/jstemmer/go-junit-report/v2@latest
go install github.com/golangci/golangci-lint/cmd/[email protected]
- run:
name: Test Kuscia
command: make test
build_kuscia:
steps:
- setup_remote_docker
- run:
name: "install go"
command: |
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64";;
aarch64) ARCH="arm64";;
*) echo "Unsupported architecture"; exit 1;;
esac
GOLANG_DIR="/usr/local"
GOLANG_VERSION="1.19.7"
GOLANG_URL="https://golang.org/dl/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
if ! command -v go &> /dev/null; then
wget "$GOLANG_URL"
tar -C "$GOLANG_DIR" -xzf "go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
echo 'export PATH=$PATH:/usr/local/go/bin' | tee -a ~/.bashrc
echo 'export PATH=$PATH:/usr/local/go/bin' >> $BASH_ENV
source ~/.bashrc
fi
- checkout
- run:
name: "make build"
command: |
Expand All @@ -106,6 +98,7 @@ jobs:
executor: <<parameters.executor>>
steps:
- checkout
- go_env
- test
linux_build_kuscia:
parameters:
Expand All @@ -114,6 +107,7 @@ jobs:
executor: <<parameters.executor>>
steps:
- checkout
- go_env
- build_kuscia
image_publish:
docker:
Expand Down Expand Up @@ -166,19 +160,23 @@ workflows:
- << pipeline.parameters.GHA_Action >>
- equal: [ "publish_kuscia_deps", << pipeline.parameters.GHA_Meta >> ]
- equal: [ "publish_pypi", << pipeline.parameters.GHA_Meta >> ]
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
jobs:
- unit-test:
matrix:
parameters:
executor: [ "linux_x64_executor", "linux_aarch64_executor" ]
- linux_build_kuscia:
matrix:
parameters:
executor: [ "linux_x64_executor", "linux_aarch64_executor" ]
- image_publish:
requires:
- linux_build_kuscia
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
build-kuscia-deps-workflow:
when:
equal: [ "publish_kuscia_deps", << pipeline.parameters.GHA_Meta >> ]
Expand Down
29 changes: 16 additions & 13 deletions .circleci/deps-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,26 @@ commands:
name: "install go"
command: |
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64";;
aarch64) ARCH="arm64";;
*) echo "Unsupported architecture"; exit 1;;
esac
GOLANG_DIR="/opt"
if [ "$ARCH" == "aarch64" ]; then
set +e
ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
ln -sf /usr/bin/bash /bin/sh
yum update -y
yum install -y wget make cmake git curl unzip gcc perl-IPC-Cmd
GOLANG_DIR="/usr/local"
GOLANG_VERSION="1.19.7"
GOLANG_URL="https://golang.org/dl/go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
GOLANG_URL="https://golang.google.cn/dl/go${GOLANG_VERSION}.linux-arm64.tar.gz"
apt-get update
apt-get install -y docker.io
if ! command -v go &> /dev/null; then
wget "$GOLANG_URL"
tar -C "$GOLANG_DIR" -xzf "go${GOLANG_VERSION}.linux-${ARCH}.tar.gz"
echo 'export PATH=$PATH:/opt/go/bin' | tee -a ~/.bashrc
echo 'export PATH=$PATH:/opt/go/bin' >> $BASH_ENV
source ~/.bashrc
tar -C "$GOLANG_DIR" -xzf "go${GOLANG_VERSION}.linux-arm64.tar.gz"
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' | tee -a ~/.bashrc
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $BASH_ENV
set -e
fi
fi
- run:
name: "make build"
Expand Down

0 comments on commit 0050592

Please sign in to comment.