Parameterize rust version in circle
This commit is contained in:
parent
487963d17a
commit
7c4a323dc4
|
|
@ -17,8 +17,11 @@ jobs:
|
||||||
no_run:
|
no_run:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
image:
|
||||||
|
type: string
|
||||||
|
default: 1.24.1
|
||||||
docker:
|
docker:
|
||||||
- image: rust:1.24.1
|
- image: rust:<< parameters.image >>
|
||||||
environment:
|
environment:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
OPENSSL_DIR: /opt/openssl
|
OPENSSL_DIR: /opt/openssl
|
||||||
|
|
@ -50,62 +53,62 @@ jobs:
|
||||||
esac
|
esac
|
||||||
|
|
||||||
rustup target add << parameters.target >>
|
rustup target add << parameters.target >>
|
||||||
- restore_cache:
|
- unless:
|
||||||
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
condition: << parameters.vendored >>
|
||||||
- run: |
|
steps:
|
||||||
if [ -d "$OPENSSL_DIR" ]; then
|
- restore_cache:
|
||||||
exit 0
|
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
||||||
fi
|
- run: |
|
||||||
|
if [ -d "$OPENSSL_DIR" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
case "<< parameters.library >>" in
|
case "<< parameters.library >>" in
|
||||||
"libressl")
|
"libressl")
|
||||||
URL="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-<< parameters.version >>.tar.gz"
|
URL="https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-<< parameters.version >>.tar.gz"
|
||||||
;;
|
;;
|
||||||
"openssl")
|
"openssl")
|
||||||
URL="https://openssl.org/source/openssl-<< parameters.version >>.tar.gz"
|
URL="https://openssl.org/source/openssl-<< parameters.version >>.tar.gz"
|
||||||
;;
|
;;
|
||||||
"")
|
esac
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
case "<< parameters.target >>" in
|
case "<< parameters.target >>" in
|
||||||
"x86_64-unknown-linux-gnu")
|
"x86_64-unknown-linux-gnu")
|
||||||
OS_COMPILER=linux-x86_64
|
OS_COMPILER=linux-x86_64
|
||||||
OS_FLAGS=""
|
OS_FLAGS=""
|
||||||
;;
|
;;
|
||||||
"i686-unknown-linux-gnu")
|
"i686-unknown-linux-gnu")
|
||||||
OS_COMPILER=linux-elf
|
OS_COMPILER=linux-elf
|
||||||
OS_FLAGS=-m32
|
OS_FLAGS=-m32
|
||||||
;;
|
;;
|
||||||
"arm-unknown-linux-gnueabihf")
|
"arm-unknown-linux-gnueabihf")
|
||||||
OS_COMPILER=linux-armv4
|
OS_COMPILER=linux-armv4
|
||||||
OS_FLAGS=""
|
OS_FLAGS=""
|
||||||
export AR=arm-linux-gnueabihf-ar
|
export AR=arm-linux-gnueabihf-ar
|
||||||
export CC=arm-linux-gnueabihf-gcc
|
export CC=arm-linux-gnueabihf-gcc
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
mkdir /tmp/build
|
mkdir /tmp/build
|
||||||
cd /tmp/build
|
cd /tmp/build
|
||||||
|
|
||||||
curl -L $URL | tar --strip-components=1 -xzf -
|
curl -L $URL | tar --strip-components=1 -xzf -
|
||||||
|
|
||||||
case "<< parameters.library >>" in
|
case "<< parameters.library >>" in
|
||||||
"openssl")
|
"openssl")
|
||||||
./Configure --prefix=$OPENSSL_DIR $OS_COMPILER -fPIC -g $OS_FLAGS no-shared
|
./Configure --prefix=$OPENSSL_DIR $OS_COMPILER -fPIC -g $OS_FLAGS no-shared
|
||||||
;;
|
;;
|
||||||
"libressl")
|
"libressl")
|
||||||
./configure --prefix=$OPENSSL_DIR --disable-shared --with-pic
|
./configure --prefix=$OPENSSL_DIR --disable-shared --with-pic
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
make
|
make
|
||||||
make install_sw
|
make install_sw
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
key: openssl-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>
|
||||||
paths:
|
paths:
|
||||||
- /opt/openssl
|
- /opt/openssl
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: registry
|
key: registry
|
||||||
- run: cargo generate-lockfile
|
- run: cargo generate-lockfile
|
||||||
|
|
@ -114,7 +117,7 @@ jobs:
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/cargo/registry/index
|
- /usr/local/cargo/registry/index
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: deps-1.24.1-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
key: deps-<< parameters.image >>-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
||||||
- run: |
|
- run: |
|
||||||
cargo run \
|
cargo run \
|
||||||
--manifest-path=systest/Cargo.toml \
|
--manifest-path=systest/Cargo.toml \
|
||||||
|
|
@ -129,7 +132,7 @@ jobs:
|
||||||
--target << parameters.target >> \
|
--target << parameters.target >> \
|
||||||
<<# parameters.no_run >>--no-run<</ parameters.no_run >>
|
<<# parameters.no_run >>--no-run<</ parameters.no_run >>
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: deps-1.24.1-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
key: deps-<< parameters.image >>-<< parameters.target >>-<< parameters.library >>-<< parameters.version >>-{{ checksum "Cargo.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- /usr/local/cargo/registry/cache
|
- /usr/local/cargo/registry/cache
|
||||||
- target
|
- target
|
||||||
|
|
@ -147,6 +150,9 @@ jobs:
|
||||||
vendored:
|
vendored:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
image:
|
||||||
|
type: string
|
||||||
|
default: 1.24.1
|
||||||
macos:
|
macos:
|
||||||
xcode: "9.0"
|
xcode: "9.0"
|
||||||
environment:
|
environment:
|
||||||
|
|
@ -155,11 +161,11 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- run: sudo mkdir /opt
|
- run: sudo mkdir /opt
|
||||||
- run: sudo chown -R $USER /usr/local/ /opt
|
- run: sudo chown -R $USER /usr/local/ /opt
|
||||||
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.24.1
|
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain << parameters.image >>
|
||||||
- run: sudo ln -s ~/.cargo/bin/* /usr/local/bin
|
- run: sudo ln -s ~/.cargo/bin/* /usr/local/bin
|
||||||
- run: cargo generate-lockfile
|
- run: cargo generate-lockfile
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: deps-1.24.1-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
key: deps-<< parameters.image >>-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
||||||
- run: |
|
- run: |
|
||||||
cargo run \
|
cargo run \
|
||||||
--manifest-path=systest/Cargo.toml \
|
--manifest-path=systest/Cargo.toml \
|
||||||
|
|
@ -170,7 +176,7 @@ jobs:
|
||||||
--manifest-path=openssl/Cargo.toml \
|
--manifest-path=openssl/Cargo.toml \
|
||||||
<<# parameters.vendored >> --features vendored <</ parameters.vendored >>
|
<<# parameters.vendored >> --features vendored <</ parameters.vendored >>
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: deps-1.24.1-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
key: deps-<< parameters.image >>-macos-<< parameters.vendored >>-{{ checksum "Cargo.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ~/.cargo/registry/cache
|
- ~/.cargo/registry/cache
|
||||||
- target
|
- target
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue