From 74e1e56a148400bbf1fa2a41048ee1ba89c0a09c Mon Sep 17 00:00:00 2001 From: Miroslav Kovar Date: Thu, 11 May 2023 09:59:04 +0200 Subject: [PATCH] Run only relevant jobs Signed-off-by: Miroslav Kovar --- .github/actions/setup-testing-rust/action.yml | 2 +- .github/workflows/main.yml | 1796 ++++++++--------- 2 files changed, 894 insertions(+), 904 deletions(-) diff --git a/.github/actions/setup-testing-rust/action.yml b/.github/actions/setup-testing-rust/action.yml index 3b652e2327..5952e0236b 100644 --- a/.github/actions/setup-testing-rust/action.yml +++ b/.github/actions/setup-testing-rust/action.yml @@ -32,7 +32,7 @@ runs: sleep 5 docker-compose -f ./ci/agency/docker-compose.yml up -d - name: "Start vdrproxy" - if: ${{ inputs.skip-vdrproxy-setup != 'false' }} + if: ${{ inputs.skip-vdrproxy-setup != 'true' }} shell: bash run: | docker run --rm -d --name vdrproxy --network host -e GENESIS=${{ env.GENESIS_URL }} -e PORT=${{ env.VDR_PROXY_PORT }} ${{ env.DOCKER_IMAGE_VDRPROXY }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8982e6de3d..eda3d580ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - main + - "**" pull_request: branches: - "**" @@ -18,23 +18,24 @@ env: DOCKER_REPO_LOCAL_ALPINE_CORE: alpine-core DOCKER_REPO_LOCAL_LIBVCX: libvcx DOCKER_REPO_LOCAL_ANDROID: android-test + DOCKER_REPO_LOCAL_VDRPROXY: vdrproxy RUST_TOOLCHAIN_VERSON: 1.65.0 NODE_VERSION: 18.x jobs: - verify-code-formatting: - runs-on: ubuntu-20.04 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - components: rustfmt, clippy - - name: "Verify code formatting" - run: | - cargo fmt --check +# verify-code-formatting: +# runs-on: ubuntu-20.04 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# components: rustfmt, clippy +# - name: "Verify code formatting" +# run: | +# cargo fmt --check workflow-setup: runs-on: ubuntu-20.04 @@ -53,6 +54,7 @@ jobs: DOCKER_IMG_CACHED_ALPINE_CORE: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }} DOCKER_IMG_CACHED_LIBVCX: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_LIBVCX }} DOCKER_IMG_CACHED_ANDROID: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_ANDROID }} + DOCKER_IMG_CACHED_VDRPROXY: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_VDRPROXY }} steps: - name: "Git checkout" uses: actions/checkout@v1 @@ -72,6 +74,7 @@ jobs: HASH_DOCKERFILE_ALPINE_CORE=${{ hashFiles('ci/alpine_core.dockerfile')}} HASH_DOCKERFILE_LIBVCX=${{ hashFiles('ci/libvcx.dockerfile') }} + HASH_DOCKERFILE_VDRPROXY=${{ hashFiles('ci/vdrproxy.dockerfile') }} HASH_SRC_LIBVDRTOOLS=${{ hashFiles('libvdrtools') }} HASH_SRC_LIBVCX=${{ hashFiles('libvcx') }} HASH_SRC_ARIESVCX=${{ hashFiles('aries_vcx') }} @@ -93,6 +96,7 @@ jobs: echo "DOCKER_IMG_CACHED_ALPINE_CORE=$DOCKER_REPO_LOCAL_ALPINE_CORE:$HASH_DOCKERFILE_ALPINE_CORE" >> $GITHUB_OUTPUT echo "DOCKER_IMG_CACHED_LIBVCX=$DOCKER_REPO_LOCAL_LIBVCX:$HASH_DOCKER_LIBVCX" >> $GITHUB_OUTPUT echo "DOCKER_IMG_CACHED_ANDROID=$DOCKER_REPO_LOCAL_ANDROID:$HASH_DOCKER_ANDROID" >> $GITHUB_OUTPUT + echo "DOCKER_IMG_CACHED_VDRPROXY=$DOCKER_REPO_LOCAL_VDRPROXY:$HASH_DOCKERFILE_VDRPROXY" >> $GITHUB_OUTPUT workflow-setup-check: runs-on: ubuntu-20.04 @@ -112,67 +116,68 @@ jobs: echo "DOCKER_IMG_CACHED_ALPINE_CORE ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}" echo "DOCKER_IMG_CACHED_LIBVCX ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }}" echo "DOCKER_IMG_CACHED_ANDROID ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}" - - clippy-aries-vcx: - runs-on: ubuntu-20.04 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - components: rustfmt, clippy - - name: "Install dependencies" - shell: bash - run: | - sudo apt-get update -y - sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev - - name: "Verify clippy warnings" - run: | - cd aries_vcx && cargo clippy - - clippy-libvcx: - runs-on: ubuntu-20.04 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - components: rustfmt, clippy - - name: "Install dependencies" - shell: bash - run: | - sudo apt-get update -y - sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev - - name: "Verify clippy warnings" - run: | - cd libvcx && cargo clippy - - check-aries-vcx-feature-variants: - runs-on: ubuntu-20.04 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - components: rustfmt, clippy - - name: "Install dependencies" - shell: bash - run: | - sudo apt-get update -y - sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev - - name: "Verify aries_vcx compiles with different dependency feature variants" - run: | - cd aries_vcx - cargo check - cargo check --no-default-features - cargo check --features vdrtools --no-default-features - cargo check --features modular_libs --no-default-features - - ########################################################################################## - ############################## DOCKER BUILD ########################################## + echo "DOCKER_IMG_CACHED_VDRPROXY ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}" + +# clippy-aries-vcx: +# runs-on: ubuntu-20.04 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# components: rustfmt, clippy +# - name: "Install dependencies" +# shell: bash +# run: | +# sudo apt-get update -y +# sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev +# - name: "Verify clippy warnings" +# run: | +# cd aries_vcx && cargo clippy +# +# clippy-libvcx: +# runs-on: ubuntu-20.04 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# components: rustfmt, clippy +# - name: "Install dependencies" +# shell: bash +# run: | +# sudo apt-get update -y +# sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev +# - name: "Verify clippy warnings" +# run: | +# cd libvcx && cargo clippy +# +# check-aries-vcx-feature-variants: +# runs-on: ubuntu-20.04 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# components: rustfmt, clippy +# - name: "Install dependencies" +# shell: bash +# run: | +# sudo apt-get update -y +# sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev +# - name: "Verify aries_vcx compiles with different dependency feature variants" +# run: | +# cd aries_vcx +# cargo check +# cargo check --no-default-features +# cargo check --features vdrtools --no-default-features +# cargo check --features modular_libs --no-default-features +# +# ########################################################################################## +# ############################## DOCKER BUILD ########################################## build-docker-alpine-core: needs: workflow-setup @@ -199,69 +204,69 @@ jobs: branch-main: ${{ env.MAIN_BRANCH }} docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_ALPINE_CORE }} - build-docker-libvcx: - needs: [ workflow-setup, build-docker-alpine-core ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - runs-on: ubuntu-20.04 - env: - DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }} - DOCKER_IMG_CACHED_ALPINE_CORE: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }} - BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Load alpine core image" - uses: ./.github/actions/load-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }} - - name: "Build and cache image" - uses: ./.github/actions/build-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED }} - build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE" - dockerfile-path: "ci/libvcx.dockerfile" - branch-name: ${{ env.BRANCH_NAME }} - branch-main: ${{ env.MAIN_BRANCH }} - docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_LIBVCX }} - - build-docker-android: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true'}} - runs-on: ubuntu-20.04 - env: - DOCKER_IMG_CACHED: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}} - BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Build and cache image" - uses: ./.github/actions/build-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED }} - dockerfile-path: "wrappers/java/ci/android.dockerfile" - branch-name: ${{ env.BRANCH_NAME }} - branch-main: ${{ env.MAIN_BRANCH }} - docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_ANDROID }} +# build-docker-libvcx: +# needs: [ workflow-setup, build-docker-alpine-core ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# runs-on: ubuntu-20.04 +# env: +# DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }} +# DOCKER_IMG_CACHED_ALPINE_CORE: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }} +# BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Load alpine core image" +# uses: ./.github/actions/load-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }} +# - name: "Build and cache image" +# uses: ./.github/actions/build-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED }} +# build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE" +# dockerfile-path: "ci/libvcx.dockerfile" +# branch-name: ${{ env.BRANCH_NAME }} +# branch-main: ${{ env.MAIN_BRANCH }} +# docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_LIBVCX }} +# +# build-docker-android: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true'}} +# runs-on: ubuntu-20.04 +# env: +# DOCKER_IMG_CACHED: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}} +# BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Build and cache image" +# uses: ./.github/actions/build-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED }} +# dockerfile-path: "wrappers/java/ci/android.dockerfile" +# branch-name: ${{ env.BRANCH_NAME }} +# branch-main: ${{ env.MAIN_BRANCH }} +# docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_ANDROID }} build-docker-vdrproxy: needs: [ workflow-setup, build-docker-alpine-core ] if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} runs-on: ubuntu-20.04 env: - DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }} DOCKER_IMG_CACHED_ALPINE_CORE: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }} + DOCKER_IMG_CACHED: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY}} BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} outputs: image-name: ${{ steps.meta.outputs.tags }} @@ -274,197 +279,182 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/${{ github.repository }} - tags: | - type=semver,pattern={{version}},value=${{ needs.workflow-setup.outputs.publish-version }} - flavor: | - latest=false - - # TODO: Is this step necessary? - # TODO: This step would be definitely unnecessary if alpine image was published - name: "Load alpine core image" uses: ./.github/actions/load-image with: docker-img: ${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }} - - - name: Build and publish docker image - uses: docker/build-push-action@v4 - with: - context: . - file: ./ci/vdrproxy.dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max - build-args: | - ALPINE_CORE_IMAGE=${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }} - - ########################################################################################## - ############################## DOCKER PUBLISH ######################################## - - publish-docker-libvcx: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, build-docker-libvcx ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - env: - DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }} - PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} - IS_FORK: ${{ needs.workflow-setup.outputs.IS_FORK }} - steps: - - name: "Git checkout" - if: ${{ env.IS_FORK == 'false' }} - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Publish versioned image" - if: ${{ env.IS_FORK == 'false' }} - uses: ./.github/actions/publish-image + - name: "Build and cache image" + uses: ./.github/actions/build-image with: docker-img: ${{ env.DOCKER_IMG_CACHED }} - publish-version: ${{ env.PUBLISH_VERSION }} - - ########################################################################################## - ############################### 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: - 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: modular_libs_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 -F 'modular_libs' -- --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 + dockerfile-path: "ci/vdrproxy.dockerfile" + build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE" + branch-name: ${{ env.BRANCH_NAME }} + branch-main: ${{ env.MAIN_BRANCH }} + docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_VDRPROXY }} ########################################################################################## - ############################### TESTING ########################################### - - test-unit-workspace: - 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 - 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 - - test-integration-aries-vcx: - 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: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -- --ignored; + ############################## DOCKER PUBLISH ######################################## - test-integration-aries-vcx-mysql: - 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: mysql_test" - run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" test_mysql -- --include-ignored; +# publish-docker-libvcx: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, build-docker-libvcx ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# env: +# DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }} +# PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }} +# IS_FORK: ${{ needs.workflow-setup.outputs.IS_FORK }} +# steps: +# - name: "Git checkout" +# if: ${{ env.IS_FORK == 'false' }} +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Publish versioned image" +# if: ${{ env.IS_FORK == 'false' }} +# uses: ./.github/actions/publish-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED }} +# publish-version: ${{ env.PUBLISH_VERSION }} +# +# ########################################################################################## +# ############################### 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: +# 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: modular_libs_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 -F 'modular_libs' -- --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 +# +# ########################################################################################## +# ############################### TESTING ########################################### +# +# test-unit-workspace: +# 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 +# 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 +# +# test-integration-aries-vcx: +# 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: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -- --ignored; +# +# test-integration-aries-vcx-mysql: +# 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: mysql_test" +# run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" test_mysql -- --include-ignored; test-integration-aries-vcx-vdrproxy: needs: [workflow-setup, build-docker-vdrproxy] @@ -485,594 +475,594 @@ jobs: - name: "Run aries-vcx tests: vdrproxy_test" run: cargo test --manifest-path="aries_vcx/Cargo.toml" --test test_pool -F vdr_proxy_ledger -- --ignored - test-integration-libvcx: - 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 testing environment" - uses: ./.github/actions/setup-testing-rust - - name: "Run libvcx tests: pool_tests" - run: | - RUST_TEST_THREADS=1 cargo test --manifest-path="libvcx/Cargo.toml" -F "pool_tests"; - - test-integration-resolver: - 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 testing environment" - uses: ./.github/actions/setup-testing-rust - - name: "Run resolver tests" - run: | - RUST_TEST_THREADS=1 cargo test -p did_doc_builder -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov --test "*" - - test-node-wrapper: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: [18.x] - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Setup NodeJS libvcx testing environment" - uses: ./.github/actions/setup-testing-nodejs - with: - skip-docker-setup: true - node-version: ${{ matrix.node-version }} - - name: "Run tests" - run: cd wrappers/node && RUST_LOG=vcx=trace npm run test - - test-integration-node-wrapper: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: [18.x] - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Setup NodeJS libvcx testing environment" - uses: ./.github/actions/setup-testing-nodejs - with: - node-version: ${{ matrix.node-version }} - - name: "Install vcxagent-core dependencies" - run: (cd agents/node/vcxagent-core && npm install) - - name: "Run demo" - run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo) - - name: "Run demo with revocation" - run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo:revocation) - - name: "Run integration tests" - run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run test:integration) - - test-android-build: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, build-docker-android ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} - env: - DOCKER_IMG_CACHED_ANDROID: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Load android image" - uses: ./.github/actions/load-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} - - name: "Run android tests" - run: | - rm -rf /tmp/imgcache - docker run --rm -i $DOCKER_IMG_CACHED_ANDROID \ - sh -c '(cd $HOME/aries-vcx && ./wrappers/java/ci/android.test.sh armv7)' - - build-and-publish-ios-wrapper: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_IOS != 'true' }} - runs-on: macos-11 - env: - LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - steps: - - name: "Git checkout" - uses: actions/checkout@v2 - - name: Switch to xcode version 12.4 - run: | - sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer - xcodebuild -version - - name: "Build iOS wrapper" - run: | - ./wrappers/ios/ci/build.sh - - uses: actions/upload-artifact@v3 - with: - name: libvcx-ios-${{ env.PUBLISH_VERSION }}-device - path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-device.zip - - uses: actions/upload-artifact@v3 - with: - name: libvcx-ios-${{ env.PUBLISH_VERSION }}-universal - path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip - - build-and-publish-ios-legacy-wrapper: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_IOS != 'true' }} - runs-on: macos-11 - env: - LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - steps: - - name: "Git checkout" - uses: actions/checkout@v2 - - name: Switch to xcode version 12.4 - run: | - sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer - xcodebuild -version - - name: "Build Legacy iOS wrapper" - run: | - ./wrappers/ios_legacy/ci/build.sh - - name: "Rename device as legacy" - run: | - mv /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-device.zip /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device.zip - - name: "Rename universal as legacy" - run: | - mv /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal.zip - - uses: actions/upload-artifact@v3 - with: - name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device - path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device.zip - - uses: actions/upload-artifact@v3 - with: - name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal - path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal.zip - - build-and-publish-android-device: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, build-docker-android ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} - env: - FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-device - DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Load android image" - uses: ./.github/actions/load-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} - - name: "Build, run android wrapper tests, and publish artifacts" - uses: ./.github/actions/publish-android - with: - abis: "arm arm64" - docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} - full-version-name: ${{ env.FULL_VERSION_NAME }} - - name: "Publish aar artifact" - uses: actions/upload-artifact@v3 - with: - name: ${{ env.FULL_VERSION_NAME }} - path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar - - build-and-publish-android-emulator: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, build-docker-android ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} - env: - FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-emulator - DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Docker Login" - uses: azure/docker-login@v1 - with: - login-server: ${{ env.URL_DOCKER_REGISTRY }} - username: $GITHUB_ACTOR - password: ${{ secrets.GITHUB_TOKEN }} - - name: "Load android image" - uses: ./.github/actions/load-image - with: - docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} - - name: "Build, run android wrapper tests, and publish artifacts" - uses: ./.github/actions/publish-android - with: - abis: "x86 x86_64" - docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} - full-version-name: ${{ env.FULL_VERSION_NAME }} - - uses: actions/upload-artifact@v3 - with: - name: ${{ env.FULL_VERSION_NAME }} - path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar - - build-and-publish-ubuntu-lib: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - runs-on: ubuntu-20.04 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - - uses: Swatinem/rust-cache@v2 - with: - key: "11" - - name: "Install dependencies" - shell: bash - run: | - sudo apt-get update -y - sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev - - name: "Build libvcx.so" - run: cargo build --release - - name: "Publish artifact libvcx.so" - uses: actions/upload-artifact@v3 - with: - name: libvcx.so - path: target/release/libvcx.so - - build-and-publish-darwin-lib: - needs: workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - runs-on: macos-11 - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.65.0 - - uses: Swatinem/rust-cache@v2 - with: - key: "11" - - name: "Install dependencies" - shell: bash - run: | - brew install openssl - brew install zeromq - brew install libsodium - brew install pkg-config - - name: "Build libvcx.dylib" - run: cargo build --release - - name: "Publish artifact libvcx.dylib" - uses: actions/upload-artifact@v3 - with: - name: libvcx.dylib - path: target/release/libvcx.dylib - - ########################################################################################## - ############################ NPMJS PUBLISHING ####################################### - - publish-node-wrapper: - runs-on: ubuntu-20.04 - needs: - - workflow-setup - - test-unit-workspace - - test-integration-libvcx - - test-integration-aries-vcx - - test-integration-aries-vcx-mysql - - test-node-wrapper - - test-integration-node-wrapper - - publish-napi - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - env: - PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Use Node.js 18" - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - name: "Publish package" - run: | - if [[ "$PUBLISH_VERSION" ]] - then - NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./wrappers/node/publish.sh - else - echo "New version was not defined, skipping release." - fi - - publish-agent-core: - runs-on: ubuntu-20.04 - needs: - - workflow-setup - - test-unit-workspace - - test-integration-libvcx - - test-integration-aries-vcx - - test-integration-aries-vcx-mysql - - test-node-wrapper - - test-integration-node-wrapper - - publish-napi - - publish-node-wrapper - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - env: - NPMJS_TOKEN: ${{ secrets.NPMJS_TOKEN }} - PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}} - steps: - - name: "Git checkout" - uses: actions/checkout@v3 - - name: "Use Node.js 18" - uses: actions/setup-node@v3 - with: - node-version: ${{ env.NODE_VERSION }} - - name: "Release agent-core package" - run: | - if [[ "$PUBLISH_VERSION" ]] - then - NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./agents/node/vcxagent-core/publish.sh - else - echo "New version was not defined, skipping release." - fi - - build-napi: - needs: - - workflow-setup - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - strategy: - fail-fast: false - matrix: - settings: - - host: ubuntu-20.04 - target: x86_64-unknown-linux-gnu - build: |- - 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 - strip *.node - - host: ubuntu-20.04 - target: x86_64-unknown-linux-musl - docker: ghcr.io/hyperledger/aries-vcx/napi-rs-alpine - build: |- - set -e - cd wrappers/vcx-napi-rs - npm run build:napi - strip *.node - - host: macos-latest - target: x86_64-apple-darwin - build: | - brew install openssl zmq pkg-config - npm run build:napi - strip -x *.node - - host: macos-latest - target: aarch64-apple-darwin - skip: ${{ needs.workflow-setup.outputs.SKIP_NAPI_M1 }} - build: | - wget https://github.com/macports/macports-base/releases/download/v2.8.0/MacPorts-2.8.0-12-Monterey.pkg - sudo installer -pkg ./MacPorts-2.8.0-12-Monterey.pkg -target / - export PATH=/opt/local/bin:/opt/local/sbin:$PATH - - sudo port install openssl +universal zmq +universal - export OPENSSL_DIR=/opt/local - export OPENSSL_INCLUDE_DIR=/opt/local/include/ - export OPENSSL_LIB_DIR=/opt/local/lib/ - - export SODIUM_LIB_DIR=/opt/local/lib/ - export SODIUM_INCLUDE_DIR=/opt/local/include - - export LIBZMQ_LIB_DIR=/opt/local/lib/ - export LIBZMQ_INCLUDE_DIR=/opt/local/include - - export PKG_CONFIG_ALLOW_CROSS=1 - export PKG_CONFIG_SYSROOT_DIR=/ - export RUST_BACKTRACE=1 - npm run build:napi -- --target aarch64-apple-darwin - strip -x *.node - name: ${{ matrix.settings.target }} - runs-on: ${{ matrix.settings.host }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/build-napi - if: ${{ matrix.settings.skip != 'true' }} - with: - docker: ${{ matrix.settings.docker }} - target: ${{ matrix.settings.target }} - build: ${{ matrix.settings.build }} - node-version: ${{ env.NODE_VERSION }} - rust-version: ${{ env.RUST_TOOLCHAIN_VERSON }} - - publish-napi: - runs-on: ubuntu-20.04 - needs: - - workflow-setup - - build-napi - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/publish-napi - with: - publish-version: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - npmjs-token: ${{ secrets.NPMJS_TOKEN }} - node-version: ${{ env.NODE_VERSION }} - - ########################################################################################## - ############################## RELEASE ######################################### - - make-release: - runs-on: ubuntu-20.04 - needs: - - workflow-setup - - build-and-publish-ios-wrapper - - build-and-publish-ios-legacy-wrapper - - build-and-publish-android-device - - build-and-publish-android-emulator - - test-unit-workspace - - test-integration-libvcx - - test-integration-aries-vcx - - test-integration-aries-vcx-mysql - - test-android-build - - test-node-wrapper - - test-integration-node-wrapper - if: ${{ needs.workflow-setup.outputs.RELEASE == 'true' || needs.workflow-setup.outputs.PRERELEASE == 'true' }} - outputs: - RELEASE_UPLOAD_URL: ${{ steps.create-release.outputs.upload_url }} - steps: - - name: "Git checkout" - uses: actions/checkout@v2 - - name: "Generate changelog" - uses: heinrichreimer/action-github-changelog-generator@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - futureRelease: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - releaseBranch: main - pullRequests: true - unreleased: false - unreleasedOnly: false - issuesWoLabels: true - prWoLabels: true - stripGeneratorNotice: true - stripHeaders: false - maxIssues: 50 - excludeLabels: duplicate,question,invalid,wontfix,changelog-excluded - breakingLabels: backwards-incompatible,breaking - deprecatedLabels: deprecated - headerLabel: "# Changelog" - breakingLabel: '### Breaking changes' - enhancementLabel: '### Enhancements' - bugsLabel: '### Bug fixes' - deprecatedLabel: '### Deprecations' - removedLabel: '### Removals' - securityLabel: '### Security fixes' - issuesLabel: '### Other issues' - prLabel: '### Other pull requests' - addSections: '{"ci":{"prefix":"### CI changes","labels":["ci"]},"wrappers":{"prefix":"### Wrapper changes","labels":["wrappers"]},"agents":{"prefix":"### Changes to agents","labels":["agents"]},"features":{"prefix":"### Features","labels":["features"]},"hotfix":{"prefix":"### Hotfixes","labels":["hotfix"]},"security":{"prefix":"### Security fixes","labels":["security"]},"refactoring":{"prefix":"### Refactoring","labels":["refactoring"]},"tests":{"prefix":"### Tests","labels":["tests"]},"update":{"prefix":"### Updates","labels":["update"]}}' - excludeTagsRegex: '^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))+)?)$' - - - name: "Create a new release" - id: create-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - release_name: Release ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} - body_path: ./CHANGELOG.md - draft: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }} - prerelease: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }} - - release-android-device: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch android device build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar - asset_name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar - asset_content_type: application/aar - - release-android-emulator: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch android emulator build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator.aar - asset_name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator.aar - asset_content_type: application/aar - - release-ios-device: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch iOS device build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip - asset_name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip - asset_content_type: application/zip - - release-ios-legacy-device: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch iOS device build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip - asset_name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip - asset_content_type: application/zip - - release-ios-universal: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch iOS universal build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip - asset_name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip - asset_content_type: application/zip - - release-ios-legacy-universal: - runs-on: ubuntu-20.04 - needs: [ workflow-setup, make-release ] - if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} - steps: - - name: "Fetch iOS universal build from artifacts" - uses: actions/download-artifact@v2 - with: - name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal - - name: "Upload release assets" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} - asset_path: ./libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip - asset_name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip - asset_content_type: application/zip +# test-integration-libvcx: +# 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 testing environment" +# uses: ./.github/actions/setup-testing-rust +# - name: "Run libvcx tests: pool_tests" +# run: | +# RUST_TEST_THREADS=1 cargo test --manifest-path="libvcx/Cargo.toml" -F "pool_tests"; +# +# test-integration-resolver: +# 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 testing environment" +# uses: ./.github/actions/setup-testing-rust +# - name: "Run resolver tests" +# run: | +# RUST_TEST_THREADS=1 cargo test -p did_doc_builder -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov --test "*" +# +# test-node-wrapper: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# runs-on: ubuntu-22.04 +# strategy: +# matrix: +# node-version: [18.x] +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Setup NodeJS libvcx testing environment" +# uses: ./.github/actions/setup-testing-nodejs +# with: +# skip-docker-setup: true +# node-version: ${{ matrix.node-version }} +# - name: "Run tests" +# run: cd wrappers/node && RUST_LOG=vcx=trace npm run test +# +# test-integration-node-wrapper: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# runs-on: ubuntu-22.04 +# strategy: +# matrix: +# node-version: [18.x] +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Setup NodeJS libvcx testing environment" +# uses: ./.github/actions/setup-testing-nodejs +# with: +# node-version: ${{ matrix.node-version }} +# - name: "Install vcxagent-core dependencies" +# run: (cd agents/node/vcxagent-core && npm install) +# - name: "Run demo" +# run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo) +# - name: "Run demo with revocation" +# run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo:revocation) +# - name: "Run integration tests" +# run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run test:integration) +# +# test-android-build: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, build-docker-android ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} +# env: +# DOCKER_IMG_CACHED_ANDROID: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Load android image" +# uses: ./.github/actions/load-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} +# - name: "Run android tests" +# run: | +# rm -rf /tmp/imgcache +# docker run --rm -i $DOCKER_IMG_CACHED_ANDROID \ +# sh -c '(cd $HOME/aries-vcx && ./wrappers/java/ci/android.test.sh armv7)' +# +# build-and-publish-ios-wrapper: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_IOS != 'true' }} +# runs-on: macos-11 +# env: +# LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v2 +# - name: Switch to xcode version 12.4 +# run: | +# sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer +# xcodebuild -version +# - name: "Build iOS wrapper" +# run: | +# ./wrappers/ios/ci/build.sh +# - uses: actions/upload-artifact@v3 +# with: +# name: libvcx-ios-${{ env.PUBLISH_VERSION }}-device +# path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-device.zip +# - uses: actions/upload-artifact@v3 +# with: +# name: libvcx-ios-${{ env.PUBLISH_VERSION }}-universal +# path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip +# +# build-and-publish-ios-legacy-wrapper: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_IOS != 'true' }} +# runs-on: macos-11 +# env: +# LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v2 +# - name: Switch to xcode version 12.4 +# run: | +# sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer +# xcodebuild -version +# - name: "Build Legacy iOS wrapper" +# run: | +# ./wrappers/ios_legacy/ci/build.sh +# - name: "Rename device as legacy" +# run: | +# mv /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-device.zip /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device.zip +# - name: "Rename universal as legacy" +# run: | +# mv /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal.zip +# - uses: actions/upload-artifact@v3 +# with: +# name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device +# path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-device.zip +# - uses: actions/upload-artifact@v3 +# with: +# name: libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal +# path: /tmp/artifacts/libvcx-ios-legacy-${{ env.PUBLISH_VERSION }}-universal.zip +# +# build-and-publish-android-device: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, build-docker-android ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} +# env: +# FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-device +# DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Load android image" +# uses: ./.github/actions/load-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} +# - name: "Build, run android wrapper tests, and publish artifacts" +# uses: ./.github/actions/publish-android +# with: +# abis: "arm arm64" +# docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} +# full-version-name: ${{ env.FULL_VERSION_NAME }} +# - name: "Publish aar artifact" +# uses: actions/upload-artifact@v3 +# with: +# name: ${{ env.FULL_VERSION_NAME }} +# path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar +# +# build-and-publish-android-emulator: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, build-docker-android ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }} +# env: +# FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-emulator +# DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Docker Login" +# uses: azure/docker-login@v1 +# with: +# login-server: ${{ env.URL_DOCKER_REGISTRY }} +# username: $GITHUB_ACTOR +# password: ${{ secrets.GITHUB_TOKEN }} +# - name: "Load android image" +# uses: ./.github/actions/load-image +# with: +# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }} +# - name: "Build, run android wrapper tests, and publish artifacts" +# uses: ./.github/actions/publish-android +# with: +# abis: "x86 x86_64" +# docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }} +# full-version-name: ${{ env.FULL_VERSION_NAME }} +# - uses: actions/upload-artifact@v3 +# with: +# name: ${{ env.FULL_VERSION_NAME }} +# path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar +# +# build-and-publish-ubuntu-lib: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# runs-on: ubuntu-20.04 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# - uses: Swatinem/rust-cache@v2 +# with: +# key: "11" +# - name: "Install dependencies" +# shell: bash +# run: | +# sudo apt-get update -y +# sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev +# - name: "Build libvcx.so" +# run: cargo build --release +# - name: "Publish artifact libvcx.so" +# uses: actions/upload-artifact@v3 +# with: +# name: libvcx.so +# path: target/release/libvcx.so +# +# build-and-publish-darwin-lib: +# needs: workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# runs-on: macos-11 +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: 1.65.0 +# - uses: Swatinem/rust-cache@v2 +# with: +# key: "11" +# - name: "Install dependencies" +# shell: bash +# run: | +# brew install openssl +# brew install zeromq +# brew install libsodium +# brew install pkg-config +# - name: "Build libvcx.dylib" +# run: cargo build --release +# - name: "Publish artifact libvcx.dylib" +# uses: actions/upload-artifact@v3 +# with: +# name: libvcx.dylib +# path: target/release/libvcx.dylib +# +# ########################################################################################## +# ############################ NPMJS PUBLISHING ####################################### +# +# publish-node-wrapper: +# runs-on: ubuntu-20.04 +# needs: +# - workflow-setup +# - test-unit-workspace +# - test-integration-libvcx +# - test-integration-aries-vcx +# - test-integration-aries-vcx-mysql +# - test-node-wrapper +# - test-integration-node-wrapper +# - publish-napi +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# env: +# PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Use Node.js 18" +# uses: actions/setup-node@v3 +# with: +# node-version: ${{ env.NODE_VERSION }} +# - name: "Publish package" +# run: | +# if [[ "$PUBLISH_VERSION" ]] +# then +# NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./wrappers/node/publish.sh +# else +# echo "New version was not defined, skipping release." +# fi +# +# publish-agent-core: +# runs-on: ubuntu-20.04 +# needs: +# - workflow-setup +# - test-unit-workspace +# - test-integration-libvcx +# - test-integration-aries-vcx +# - test-integration-aries-vcx-mysql +# - test-node-wrapper +# - test-integration-node-wrapper +# - publish-napi +# - publish-node-wrapper +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# env: +# NPMJS_TOKEN: ${{ secrets.NPMJS_TOKEN }} +# PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v3 +# - name: "Use Node.js 18" +# uses: actions/setup-node@v3 +# with: +# node-version: ${{ env.NODE_VERSION }} +# - name: "Release agent-core package" +# run: | +# if [[ "$PUBLISH_VERSION" ]] +# then +# NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./agents/node/vcxagent-core/publish.sh +# else +# echo "New version was not defined, skipping release." +# fi +# +# build-napi: +# needs: +# - workflow-setup +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# strategy: +# fail-fast: false +# matrix: +# settings: +# - host: ubuntu-20.04 +# target: x86_64-unknown-linux-gnu +# build: |- +# 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 +# strip *.node +# - host: ubuntu-20.04 +# target: x86_64-unknown-linux-musl +# docker: ghcr.io/hyperledger/aries-vcx/napi-rs-alpine +# build: |- +# set -e +# cd wrappers/vcx-napi-rs +# npm run build:napi +# strip *.node +# - host: macos-latest +# target: x86_64-apple-darwin +# build: | +# brew install openssl zmq pkg-config +# npm run build:napi +# strip -x *.node +# - host: macos-latest +# target: aarch64-apple-darwin +# skip: ${{ needs.workflow-setup.outputs.SKIP_NAPI_M1 }} +# build: | +# wget https://github.com/macports/macports-base/releases/download/v2.8.0/MacPorts-2.8.0-12-Monterey.pkg +# sudo installer -pkg ./MacPorts-2.8.0-12-Monterey.pkg -target / +# export PATH=/opt/local/bin:/opt/local/sbin:$PATH +# +# sudo port install openssl +universal zmq +universal +# export OPENSSL_DIR=/opt/local +# export OPENSSL_INCLUDE_DIR=/opt/local/include/ +# export OPENSSL_LIB_DIR=/opt/local/lib/ +# +# export SODIUM_LIB_DIR=/opt/local/lib/ +# export SODIUM_INCLUDE_DIR=/opt/local/include +# +# export LIBZMQ_LIB_DIR=/opt/local/lib/ +# export LIBZMQ_INCLUDE_DIR=/opt/local/include +# +# export PKG_CONFIG_ALLOW_CROSS=1 +# export PKG_CONFIG_SYSROOT_DIR=/ +# export RUST_BACKTRACE=1 +# npm run build:napi -- --target aarch64-apple-darwin +# strip -x *.node +# name: ${{ matrix.settings.target }} +# runs-on: ${{ matrix.settings.host }} +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/build-napi +# if: ${{ matrix.settings.skip != 'true' }} +# with: +# docker: ${{ matrix.settings.docker }} +# target: ${{ matrix.settings.target }} +# build: ${{ matrix.settings.build }} +# node-version: ${{ env.NODE_VERSION }} +# rust-version: ${{ env.RUST_TOOLCHAIN_VERSON }} +# +# publish-napi: +# runs-on: ubuntu-20.04 +# needs: +# - workflow-setup +# - build-napi +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/publish-napi +# with: +# publish-version: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# npmjs-token: ${{ secrets.NPMJS_TOKEN }} +# node-version: ${{ env.NODE_VERSION }} +# +# ########################################################################################## +# ############################## RELEASE ######################################### +# +# make-release: +# runs-on: ubuntu-20.04 +# needs: +# - workflow-setup +# - build-and-publish-ios-wrapper +# - build-and-publish-ios-legacy-wrapper +# - build-and-publish-android-device +# - build-and-publish-android-emulator +# - test-unit-workspace +# - test-integration-libvcx +# - test-integration-aries-vcx +# - test-integration-aries-vcx-mysql +# - test-android-build +# - test-node-wrapper +# - test-integration-node-wrapper +# if: ${{ needs.workflow-setup.outputs.RELEASE == 'true' || needs.workflow-setup.outputs.PRERELEASE == 'true' }} +# outputs: +# RELEASE_UPLOAD_URL: ${{ steps.create-release.outputs.upload_url }} +# steps: +# - name: "Git checkout" +# uses: actions/checkout@v2 +# - name: "Generate changelog" +# uses: heinrichreimer/action-github-changelog-generator@v2.3 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} +# futureRelease: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# releaseBranch: main +# pullRequests: true +# unreleased: false +# unreleasedOnly: false +# issuesWoLabels: true +# prWoLabels: true +# stripGeneratorNotice: true +# stripHeaders: false +# maxIssues: 50 +# excludeLabels: duplicate,question,invalid,wontfix,changelog-excluded +# breakingLabels: backwards-incompatible,breaking +# deprecatedLabels: deprecated +# headerLabel: "# Changelog" +# breakingLabel: '### Breaking changes' +# enhancementLabel: '### Enhancements' +# bugsLabel: '### Bug fixes' +# deprecatedLabel: '### Deprecations' +# removedLabel: '### Removals' +# securityLabel: '### Security fixes' +# issuesLabel: '### Other issues' +# prLabel: '### Other pull requests' +# addSections: '{"ci":{"prefix":"### CI changes","labels":["ci"]},"wrappers":{"prefix":"### Wrapper changes","labels":["wrappers"]},"agents":{"prefix":"### Changes to agents","labels":["agents"]},"features":{"prefix":"### Features","labels":["features"]},"hotfix":{"prefix":"### Hotfixes","labels":["hotfix"]},"security":{"prefix":"### Security fixes","labels":["security"]},"refactoring":{"prefix":"### Refactoring","labels":["refactoring"]},"tests":{"prefix":"### Tests","labels":["tests"]},"update":{"prefix":"### Updates","labels":["update"]}}' +# excludeTagsRegex: '^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))+)?)$' +# +# - name: "Create a new release" +# id: create-release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# tag_name: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# release_name: Release ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }} +# body_path: ./CHANGELOG.md +# draft: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }} +# prerelease: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }} +# +# release-android-device: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch android device build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar +# asset_name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar +# asset_content_type: application/aar +# +# release-android-emulator: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch android emulator build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator.aar +# asset_name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator.aar +# asset_content_type: application/aar +# +# release-ios-device: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch iOS device build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip +# asset_name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip +# asset_content_type: application/zip +# +# release-ios-legacy-device: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch iOS device build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip +# asset_name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.zip +# asset_content_type: application/zip +# +# release-ios-universal: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch iOS universal build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip +# asset_name: libvcx-ios-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip +# asset_content_type: application/zip +# +# release-ios-legacy-universal: +# runs-on: ubuntu-20.04 +# needs: [ workflow-setup, make-release ] +# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }} +# steps: +# - name: "Fetch iOS universal build from artifacts" +# uses: actions/download-artifact@v2 +# with: +# name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal +# - name: "Upload release assets" +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }} +# asset_path: ./libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip +# asset_name: libvcx-ios-legacy-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-universal.zip +# asset_content_type: application/zip