More mdoc fixes #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - "**" | |
| push: | |
| branches: | |
| - main | |
| merge_group: | |
| jobs: | |
| integration-tests: | |
| name: "Integration Tests" | |
| runs-on: ubuntu-latest | |
| if: (github.repository == 'openwallet-foundation/acapy-plugins') && ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name != 'pull_request')) | |
| steps: | |
| #---------------------------------------------- | |
| # Check out repo | |
| #---------------------------------------------- | |
| - name: Check out repository | |
| uses: actions/checkout@v6 | |
| #---------------------------------------------- | |
| # Get docker compose | |
| #---------------------------------------------- | |
| - name: Initialize Docker Compose | |
| uses: isbang/[email protected] | |
| #---------------------------------------------- | |
| # Get changed files | |
| #---------------------------------------------- | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/[email protected] | |
| #---------------------------------------------- | |
| # Get changed plugins | |
| #---------------------------------------------- | |
| - name: Get changed plugins | |
| id: changed-plugins | |
| run: | | |
| # Collects all the plugin names that have changes. | |
| # If there is directory that isn't a plugin then it will need to skip it. Currently skipping plugin_globals | |
| declare -a changed_dirs=() | |
| for dir in ./*/; do | |
| current_folder=$(basename "$dir") | |
| if [[ $current_folder == "plugin_globals" ]]; then | |
| continue | |
| fi | |
| for changed_file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
| if [[ $changed_file == *"$current_folder"* ]]; then | |
| if ! [[ ${changed_dirs[*]} =~ $current_folder ]]; then | |
| changed_dirs+=("$current_folder") | |
| fi | |
| fi | |
| done | |
| done | |
| # Remove any lite plugins from the changed_dirs array | |
| readarray -t lite_plugin_array < lite_plugins | |
| echo "${changed_dirs[@]}" | |
| echo "${lite_plugin_array[@]}" | |
| # Function to remove items in array2 from array1 | |
| remove_items() { | |
| local -n source_array=$1 | |
| local -n remove_array=$2 | |
| local temp_array=() | |
| for item in "${source_array[@]}"; do | |
| skip=false | |
| for remove_item in "${remove_array[@]}"; do | |
| if [[ "$item" == "$remove_item" ]]; then | |
| skip=true | |
| break | |
| fi | |
| done | |
| if ! $skip; then | |
| temp_array+=("$item") | |
| fi | |
| done | |
| source_array=("${temp_array[@]}") | |
| } | |
| remove_items changed_dirs lite_plugin_array | |
| echo "changed-plugins=${changed_dirs[*]}" >> $GITHUB_OUTPUT | |
| #---------------------------------------------- | |
| # Run Integration Tests | |
| #---------------------------------------------- | |
| - name: Run Integration Tests | |
| id: integration-tests | |
| shell: bash | |
| run: | | |
| for dir in ${{ steps.changed-plugins.outputs.changed-plugins }}; do | |
| if [[ "$dir" == "cheqd" ]]; then | |
| echo "⏭️ Skipping integration tests for $dir" | |
| continue | |
| fi | |
| echo "🔧 Running integration tests for $dir" | |
| cd "$dir/integration" | |
| # Source init-network.sh if it exists | |
| if [ -f ./init-network.sh ]; then | |
| echo "📡 Sourcing init-network.sh" | |
| . ./init-network.sh | |
| fi | |
| docker compose build | |
| if [[ "$dir" == "cache_redis" ]]; then | |
| # Start everything in the background | |
| echo "🚀 Starting docker compose stack..." | |
| docker compose up -d | |
| echo "🧪 Running tests container..." | |
| docker compose run --rm tests | |
| TEST_EXIT=$? | |
| if [[ $TEST_EXIT -ne 0 ]]; then | |
| echo "❌ Tests failed for $dir - dumping logs:" | |
| docker compose logs || true | |
| docker compose down --remove-orphans | |
| exit $TEST_EXIT | |
| fi | |
| else | |
| # Normal plugin flow | |
| if ! docker compose up --exit-code-from tests; then | |
| echo "❌ Tests failed for $dir - dumping logs:" | |
| docker compose logs | |
| docker compose down --remove-orphans | |
| exit 1 | |
| fi | |
| fi | |
| echo "✅ Tests passed for $dir" | |
| docker compose down --remove-orphans | |
| cd ../.. | |
| done |