Skip to content

Commit

Permalink
build vendored openssl
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Whitehead <[email protected]>
  • Loading branch information
andrewwhitehead committed Feb 2, 2021
1 parent 155c294 commit e4f013d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:

- name: Build library
env:
BUILD_FEATURES: vendored
BUILD_TARGET: ${{ matrix.target }}
run: ./build.sh

Expand Down Expand Up @@ -75,6 +76,7 @@ jobs:

- name: Build library
env:
BUILD_FEATURES: vendored
BUILD_TARGET: ${{ matrix.target }}
BUILD_TOOLCHAIN: ${{ matrix.toolchain }}
run: ./build.sh
Expand Down
50 changes: 38 additions & 12 deletions .github/workflows/rusttest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ on:
branches: [main]

jobs:
test:
name: Test Suite
lints:
name: Lints

strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- name: Checkout sources
Expand All @@ -40,25 +36,55 @@ jobs:
command: fmt
args: --all -- --check

test:
name: Test Suite
needs: [lints]

strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Cache cargo resources
uses: Swatinem/rust-cache@v1

- name: Debug build
uses: actions-rs/cargo@v1
with:
command: build
args: --all-targets
args: --manifest-path indy-credx/Cargo.toml --features vendored

- name: Test default features
- name: Test indy-utils
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path indy-utils/Cargo.toml

- name: Test CL
- name: Test indy-data-types (CL)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path indy-data-types/Cargo.toml --features cl

- name: Test CL-native
- name: Test indy-data-types (CL-native)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path indy-data-types/Cargo.toml --features cl_native,vendored

- name: Test indy-credx (vendored)
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path indy-data-types/Cargo.toml --features cl_native
args: --manifest-path indy-credx/Cargo.toml --features vendored
5 changes: 3 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
RUSTUP=${RUSTUP:-`command -v rustup`}
PROJECT=indy-credx
LIB_NAME=indy_credx
FEATURES="${BUILD_FEATURES:-default}"

if [ ! -x "$RUSTUP" ]; then
echo "rustup command not found: it can be obtained from https://rustup.rs/"
Expand Down Expand Up @@ -75,7 +76,7 @@ if [ "$TARGET" = "apple-darwin" ]; then
TARGET_LIBS=
for target in $MACOS_UNIVERSAL_TARGETS; do
echo "Building $PROJECT for toolchain '$BUILD_TOOLCHAIN', target '$target'.."
$RUSTUP run $BUILD_TOOLCHAIN cargo build --release --target $target
$RUSTUP run $BUILD_TOOLCHAIN cargo build --manifest-path indy-credx/Cargo.toml --release --features $FEATURES --target $target
TARGET_LIBS="./target/$target/release/lib${LIB_NAME}.dylib $TARGET_LIBS"
done

Expand All @@ -86,7 +87,7 @@ if [ "$TARGET" = "apple-darwin" ]; then
else
# Build normal target
echo "Building $PROJECT for toolchain '$BUILD_TOOLCHAIN'.."
CMD="$RUSTUP run $BUILD_TOOLCHAIN cargo build --release"
CMD="$RUSTUP run $BUILD_TOOLCHAIN cargo build --manifest-path indy-credx/Cargo.toml --release --features $FEATURES"
if [ -n "$TARGET" ]; then
$CMD --target "$TARGET"
else
Expand Down
1 change: 1 addition & 0 deletions indy-credx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ crate-type = ["staticlib", "rlib", "cdylib"]
default = ["ffi"]
ffi = ["ffi-support", "logger", "zeroize"]
logger = ["env_logger"]
vendored = ["indy-data-types/vendored"]

[dependencies]
env_logger = { version = "0.7.1", optional = true }
Expand Down
2 changes: 2 additions & 0 deletions indy-data-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ hash = ["indy-utils/hash"]
merkle_tree = ["hash"]
rich_schema = []
serde_support = ["indy-utils/serde_support", "serde", "serde_json"]
vendored = ["openssl", "openssl/vendored"]

[dependencies]
openssl = { version = "0.10", optional = true }
once_cell = "1.4"
regex = "1.3"
serde = { version = "1.0", optional = true, features = ["derive"] }
Expand Down

0 comments on commit e4f013d

Please sign in to comment.