|
1 | | -name: PostgreSQL and Vault verification |
2 | | - |
| 1 | +name: Native infrastructure verification |
3 | 2 | on: |
4 | 3 | workflow_call: |
5 | | - |
6 | 4 | permissions: |
7 | 5 | contents: read |
8 | | - |
9 | 6 | jobs: |
10 | | - real-dependencies: |
| 7 | + isolated-dependencies: |
11 | 8 | runs-on: ubuntu-latest |
12 | | - timeout-minutes: 25 |
| 9 | + timeout-minutes: 35 |
| 10 | + env: |
| 11 | + COMPOSE_PROJECT_NAME: payguard-it-ci |
| 12 | + PAYGUARD_RUNTIME_ROOT: /dev/shm/payguard-it-ci |
| 13 | + PAYGUARD_POSTGRES_IDENTITY_VOLUME: payguard-it-ci_identity |
| 14 | + PAYGUARD_POSTGRES_WALLET_VOLUME: payguard-it-ci_wallet |
| 15 | + PAYGUARD_POSTGRES_LOAN_VOLUME: payguard-it-ci_loan |
| 16 | + PAYGUARD_POSTGRES_COLLATERAL_VOLUME: payguard-it-ci_collateral |
| 17 | + PAYGUARD_VAULT_DATA_VOLUME: payguard-it-ci_vault |
| 18 | + PAYGUARD_VAULT_AUDIT_VOLUME: payguard-it-ci_audit |
| 19 | + PAYGUARD_KAFKA_DATA_VOLUME: payguard-it-ci_kafka |
13 | 20 | steps: |
14 | 21 | - uses: actions/checkout@v7 |
15 | 22 | - uses: actions/setup-java@v6 |
16 | 23 | with: |
17 | 24 | distribution: temurin |
18 | 25 | java-version: '25' |
19 | 26 | cache: maven |
20 | | - - name: PostgreSQL migrations and competing transactions |
21 | | - run: >- |
22 | | - ./mvnw -B -ntp -pl payguard-identity-service,payguard-loan-service,payguard-collateral-service -am |
23 | | - -Dtest=PostgreSqlTlsTest,PostgresqlMigrationRehearsalTest,SanitizedDependencyErrorTest,OtpInfrastructureIntegrationTest,OtpApplicationContractsTest,LoanServiceApplicationTests,CollateralServiceApplicationTests |
24 | | - -Dsurefire.failIfNoSpecifiedTests=false clean test |
25 | | - - name: Build protected migration and integration runners |
26 | | - run: >- |
27 | | - ./mvnw -B -ntp -pl payguard-identity-service,payguard-wallet-service,payguard-loan-service,payguard-collateral-service -am -DskipTests package dependency:copy-dependencies -DincludeScope=test |
28 | | - - name: Verify synthetic export and approved identifier mapping |
29 | | - run: python3 -m unittest discover -s scripts/migration -p 'test_*.py' |
30 | | - - name: Prepare isolated TLS infrastructure |
| 27 | + - name: Install native Ansible dependencies and offline test dependencies |
31 | 28 | run: | |
32 | | - python3 scripts/local/prepare.py |
33 | | - docker compose --env-file .env.example up -d --wait postgres-wallet postgres-loan postgres-collateral postgres-identity vault |
34 | | - python3 scripts/local/vault_bootstrap.py |
35 | | - - name: Apply separately privileged Flyway migrations |
| 29 | + python3 -m venv /tmp/payguard-ansible |
| 30 | + /tmp/payguard-ansible/bin/pip install -r infrastructure/operations/requirements.txt -r infrastructure/tests-requirements.txt |
| 31 | + /tmp/payguard-ansible/bin/ansible-galaxy collection install -r infrastructure/operations/requirements.yml |
| 32 | + echo /tmp/payguard-ansible/bin >> "$GITHUB_PATH" |
| 33 | + echo "PAYGUARD_REPO_ROOT=$GITHUB_WORKSPACE" >> "$GITHUB_ENV" |
| 34 | + echo "PAYGUARD_LOCAL_UID=$(id -u)" >> "$GITHUB_ENV" |
| 35 | + echo "PAYGUARD_LOCAL_GID=$(id -g)" >> "$GITHUB_ENV" |
| 36 | + echo "PAYGUARD_DOCKER_GID=$(stat -c %g /var/run/docker.sock)" >> "$GITHUB_ENV" |
| 37 | + mkdir -m 700 "$PAYGUARD_RUNTIME_ROOT" |
| 38 | + - name: Verify source contracts and build applications |
36 | 39 | run: | |
37 | | - python3 scripts/local/migrate.py identity |
38 | | - python3 scripts/local/migrate.py loan |
39 | | - python3 scripts/local/migrate.py collateral |
40 | | - - name: Verify actual pools, scoped secrets and Vault audit |
41 | | - run: python3 scripts/local/verify_vault.py |
42 | | - - name: Boot actual packaged services with scoped credentials |
43 | | - run: python3 scripts/local/verify_applications.py |
44 | | - - name: Preserve test reports |
| 40 | + python3 -m unittest discover -s infrastructure/tests -v |
| 41 | + ./mvnw -B -ntp -pl payguard-identity-service,payguard-wallet-service,payguard-loan-service,payguard-collateral-service -am test package |
| 42 | + - name: Prepare isolated fixture and allocate only new explicit volumes |
| 43 | + run: | |
| 44 | + ansible-playbook -i localhost, -c local infrastructure/operations/prepare.yml -e fresh_target=true |
| 45 | + ansible-playbook -i localhost, -c local infrastructure/operations/allocate.yml -e fresh_target=true |
| 46 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml --profile operations build operations |
| 47 | + docker compose up -d --wait postgres-identity postgres-wallet postgres-loan postgres-collateral |
| 48 | + docker compose up -d vault |
| 49 | + - name: Initialize and provision the new fixture through Ansible |
| 50 | + run: | |
| 51 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/vault-lifecycle.yml -e operation=initialize -e fresh_target=true -e local_rehearsal=true |
| 52 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/site.yml -e fresh_target=true |
| 53 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml up -d agent-operator |
| 54 | + - name: Run all four CLI migrations twice |
| 55 | + run: | |
| 56 | + for pass in 1 2; do |
| 57 | + for service in identity wallet loan collateral; do |
| 58 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/migrate.yml -e service="$service" |
| 59 | + done |
| 60 | + done |
| 61 | + - name: Verify privilege boundaries and native Agent security |
| 62 | + run: | |
| 63 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/tests/integration.yml |
| 64 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/tests/agent.yml -e isolated_target=true |
| 65 | + - name: Boot and verify actual packaged applications |
| 66 | + run: | |
| 67 | + docker compose --profile applications up -d --build |
| 68 | + docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/tests/applications.yml |
| 69 | + - name: Rehearse an isolated Vault outage and recovery |
| 70 | + run: docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml run --rm --no-deps operations infrastructure/operations/tests/recovery.yml |
| 71 | + - name: Preserve Java test reports |
45 | 72 | if: always() |
46 | 73 | uses: actions/upload-artifact@v7 |
47 | 74 | with: |
48 | | - name: database-security-reports |
49 | | - path: | |
50 | | - **/target/surefire-reports/TEST-*.xml |
51 | | - payguard-shared/target/vault-test-reports/*.xml |
| 75 | + name: native-infrastructure-java-reports |
| 76 | + path: '**/target/surefire-reports/TEST-*.xml' |
52 | 77 | if-no-files-found: warn |
53 | | - - name: Stop isolated infrastructure |
| 78 | + - name: Stop only this isolated fixture |
54 | 79 | if: always() |
55 | | - run: docker compose --env-file .env.example stop |
| 80 | + run: docker compose -f docker-compose.yaml -f infrastructure/compose.operations.yaml --profile applications --profile operations stop |
0 commit comments