Skip to content

Commit

Permalink
Merge branch 'main' into gm/870-simple-message-relay
Browse files Browse the repository at this point in the history
Signed-off-by: gmulhearn <[email protected]>
  • Loading branch information
gmulhearn committed Jul 19, 2023
2 parents 4ddcf7b + 3009224 commit bd7f481
Show file tree
Hide file tree
Showing 197 changed files with 5,176 additions and 6,288 deletions.
24 changes: 18 additions & 6 deletions .github/actions/build-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ inputs:
branch-main:
description: "Current branch name. This is used to optimize build if no image is resolved using 'branch-name' input"
default: main
skip-build-optimization:
description: "If set to true, will not try to load image from cache"
default: false

runs:
using: "composite"
Expand Down Expand Up @@ -52,14 +55,23 @@ runs:
GITHUB_REPOSITORY_LOWERCASE=`echo $GITHUB_REPOSITORY | awk '{print tolower($0)}'`
REMOTE_DOCKER_REPOSITORY="${URL_DOCKER_REGISTRY}/${GITHUB_REPOSITORY_LOWERCASE}/${{ inputs.docker-repo-local-name }}"
LAST_BRANCH_BUILD="$REMOTE_DOCKER_REPOSITORY:${{ inputs.branch-name }}"
if ! docker pull "$LAST_BRANCH_BUILD"; then
LAST_MASTER_BUILD="$REMOTE_DOCKER_REPOSITORY:${{ inputs.branch-main }}"
echo "Could not pull $LAST_MASTER_BUILD, will try last master build $LAST_MASTER_BUILD"
if ! docker pull "$LAST_MASTER_BUILD"; then
echo "Could not pull $LAST_MASTER_BUILD either ¯\_(ツ)_/¯. Will just have to build the image from scratch."
if [ "${{ inputs.skip-build-optimization }}" == "false" ]; then
LAST_BRANCH_BUILD="$REMOTE_DOCKER_REPOSITORY:${{ inputs.branch-name }}"
if ! docker pull "$LAST_BRANCH_BUILD"; then
LAST_MASTER_BUILD="$REMOTE_DOCKER_REPOSITORY:${{ inputs.branch-main }}"
echo "Could not pull $LAST_BRANCH_BUILD, will try last master build $LAST_MASTER_BUILD"
if ! docker pull "$LAST_MASTER_BUILD"; then
echo "Could not pull $LAST_MASTER_BUILD either ¯\_(ツ)_/¯. Will just have to build the image from scratch."
else
echo "Pulled image from previous ${{ inputs.branch-main }} branch build. We'll try to reuse the layers from this image."
fi;
else
echo "Pulled image from previous CI run on this branch. We'll try to reuse the layers from this image."
fi;
else
echo "Build optimization is disabled, will not attempt to reuse docker layers from previous cached images."
fi;
- name: "If NOT found in cache, build and cache image."
if: steps.loadcachedimg.outputs.cache-hit != 'true'
shell: bash
Expand Down
143 changes: 68 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
run: |
cd aries_vcx
cargo check
cargo check --tests --all-features
cargo check --no-default-features
cargo check --features vdrtools --no-default-features
cargo check --features modular_libs --no-default-features
Expand Down Expand Up @@ -276,6 +277,7 @@ jobs:
- name: "Build and cache image"
uses: ./.github/actions/build-image
with:
skip-build-optimization: true # prevent pulling "main" branch image, because it's taking up lot of disk space.
docker-img: ${{ env.DOCKER_IMG_CACHED }}
dockerfile-path: "wrappers/java/ci/android.dockerfile"
branch-name: ${{ env.BRANCH_NAME }}
Expand Down Expand Up @@ -372,71 +374,8 @@ jobs:

# ##########################################################################################
# ############################### CODECOV ###########################################
#
code-coverage-aries-vcx-unit-tests:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust codecov environment"
uses: ./.github/actions/setup-codecov-rust
with:
skip-docker-setup: true
- name: "Run workspace tests: general_test"
run: |
RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --package aries-vcx;
mkdir -p /tmp/artifacts/coverage
grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o /tmp/artifacts/coverage/coverage.lcov
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
directory: /tmp/artifacts/coverage
flags: unittests-aries-vcx
name: codecov-unit-aries-vcx
fail_ci_if_error: true
path_to_write_report: /tmp/artifacts/coverage/codecov_report.gz
- uses: actions/upload-artifact@v3
with:
name: code-coverage-report-unit-aries-vcx
path: /tmp/artifacts/coverage

code-coverage-aries-vcx-integration-tests:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust codecov environment"
uses: ./.github/actions/setup-codecov-rust
- name: "Run workspace tests: pool_tests agency_pool_tests"
run: |
RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --package aries-vcx -- --ignored;
mkdir -p /tmp/artifacts/coverage
grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o /tmp/artifacts/coverage/coverage.lcov
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
directory: /tmp/artifacts/coverage
flags: unittests-aries-vcx
name: codecov-unit-aries-vcx
fail_ci_if_error: true
path_to_write_report: /tmp/artifacts/coverage/codecov_report.gz
- uses: actions/upload-artifact@v3
with:
name: code-coverage-report-unit-aries-vcx
path: /tmp/artifacts/coverage

#TODO - can this be included within code-coverage-aries-vcx-integration-tests?
code-coverage-aries-vcx-modular-dependencies-integration-tests:
code-coverage-aries-vcx-integration-modular-libs:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
Expand All @@ -445,7 +384,7 @@ jobs:
uses: actions/checkout@v3
- name: "Setup rust codecov environment"
uses: ./.github/actions/setup-codecov-rust
- name: "Run workspace tests: modular_libs_tests pool_tests agency_pool_tests"
- name: "Run workspace tests: modular libs profile"
run: |
RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
Expand All @@ -472,26 +411,38 @@ jobs:
test-unit-workspace:
needs: workflow-setup
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"anoncreds_vdrtools",
"anoncreds_credx",
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
with:
skip-docker-setup: true
- name: "Run workspace tests: general_test"
run: RUST_TEST_THREADS=1 cargo test --workspace --lib --exclude aries-vcx-agent --exclude libvdrtools
- name: "Run workspace unit tests"
run: RUST_TEST_THREADS=1 cargo test --workspace --lib --exclude aries-vcx-agent --exclude libvdrtools --exclude wallet_migrator --features ${{ matrix.features }}

test-integration-aries-vcx:
needs: workflow-setup
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"vdrtools",
"modular_libs"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx tests: pool_tests agency_pool_tests"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -- --ignored;
- name: "Run aries-vcx integration tests"
run: RUST_LOG=trace RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" --features ${{ matrix.features }} -- --ignored;

test-integration-aries-vcx-mysql:
needs: workflow-setup
Expand Down Expand Up @@ -525,7 +476,7 @@ jobs:
with:
skip-vdrproxy-setup: false
- name: "Run aries-vcx tests: vdrproxy_test"
run: cargo test --manifest-path="aries_vcx/Cargo.toml" -F vdr_proxy_ledger -- --ignored
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F vdr_proxy_ledger -- --ignored
- name: "Collect docker logs on failure"
if: failure()
uses: ./.github/actions/upload-docker-logs
Expand All @@ -540,22 +491,64 @@ jobs:
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx tests: pool_tests agency_pool_tests"
- name: "Run aries-vcx integration tests"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F mixed_breed -- --include-ignored;

test-integration-aries-vcx-migration:
needs: workflow-setup
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx tests: pool_tests agency_pool_tests"
run: |
cargo test --manifest-path="wallet_migrator/Cargo.toml";
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_creds_proofs -- --include-ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_creds_proofs_revocations -- --include-ignored;
test-integration-libvcx:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"ledger_vdrtools,anoncreds_vdrtools",
"ledger_vdrtools,anoncreds_credx",
"ledger_indyvdr,anoncreds_vdrtools",
"ledger_indyvdr,anoncreds_credx"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run libvcx tests: pool_tests"
- name: "Run libvcx_core integration tests"
run: |
RUST_TEST_THREADS=1 cargo test --manifest-path="libvcx/Cargo.toml" -F "pool_tests";
RUST_TEST_THREADS=1 cargo test --manifest-path="libvcx_core/Cargo.toml" -F "pool_tests";
RUST_TEST_THREADS=1 cargo test --features ${{ matrix.features }} --manifest-path="libvcx_core/Cargo.toml" -- --include-ignored;
test-integration-libvcx-c:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"ledger_vdrtools,anoncreds_vdrtools",
"ledger_vdrtools,anoncreds_credx",
"ledger_indyvdr,anoncreds_vdrtools",
"ledger_indyvdr,anoncreds_credx"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run libvcx unit tests"
run: |
RUST_TEST_THREADS=1 cargo test --features ${{ matrix.features }} --manifest-path="libvcx/Cargo.toml";
test-integration-resolver:
needs: workflow-setup
Expand Down Expand Up @@ -858,7 +851,7 @@ jobs:
set -e
sudo apt-get update -y
sudo apt-get install -y libssl-dev libzmq3-dev
npm run build:napi -- --target x86_64-unknown-linux-gnu
npm run build:napi
strip *.node
- host: ubuntu-20.04
target: x86_64-unknown-linux-musl
Expand Down
Loading

0 comments on commit bd7f481

Please sign in to comment.