add docker-compose development network #4
Workflow file for this run
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
| # | |
| # Copyright IBM Corp. All Rights Reserved. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| name: Devnet Integration Test | |
| on: | |
| push: | |
| branches: ["main"] | |
| paths: ["devnet/**", ".github/workflows/devnet-test.yml"] | |
| pull_request: | |
| branches: ["main"] | |
| paths: ["devnet/**", ".github/workflows/devnet-test.yml"] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: Devnet Integration Test | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: devnet | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Init (crypto + genesis block) | |
| run: make init | |
| - name: Start Org1 | |
| run: make start | |
| - name: Create namespace | |
| run: make init-namespace-org1 | |
| - name: Stop (volumes preserved) | |
| run: make stop | |
| - name: Start both orgs | |
| run: make start-both | |
| - name: Verify namespace persists | |
| run: | | |
| output=$(make list-namespaces) | |
| echo "$output" | |
| count=$(echo "$output" | grep -c ") mynamespace:") | |
| [ "$count" -eq 1 ] || { echo "Expected 1 namespace, found $count"; exit 1; } | |
| - name: Verify no exited or unhealthy containers | |
| run: | | |
| exited=$(docker ps -a --filter label=com.docker.compose.project=fabric-x --filter status=exited -q) | |
| [ -z "$exited" ] || { echo "Exited containers detected:"; docker ps -a; exit 1; } | |
| unhealthy=$(docker ps --filter label=com.docker.compose.project=fabric-x --filter health=unhealthy -q) | |
| [ -z "$unhealthy" ] || { echo "Unhealthy containers detected:"; docker ps; exit 1; } | |
| - name: Purge | |
| run: make purge | |
| - name: Verify all containers removed | |
| run: | | |
| remaining=$(docker ps --filter label=com.docker.compose.project=fabric-x -q) | |
| [ -z "$remaining" ] || { echo "Containers still running after purge:"; docker ps; exit 1; } | |
| - name: Dump logs on failure | |
| if: failure() | |
| run: | | |
| docker ps -a | |
| docker compose -f compose.yaml -f compose.org2.yaml logs --tail=100 2>/dev/null || true | |
| docker compose -f compose.test-committer.yaml logs --tail=100 2>/dev/null || true |