name: CI run-name: "${{ inputs.proof_operation || 'checks' }} / ${{ inputs.proof_request_id || github.sha }}" on: pull_request: push: branches: [main] workflow_dispatch: inputs: proof_operation: description: Temporary isolated AWS acceptance; requires separately scoped environment type: choice options: [none, doctor, upgrade, upgrade-interrupt] default: none proof_plan_id: description: Exact reviewed upgrade plan ID; required for upgrade type: string required: false proof_request_id: description: Unique acceptance request correlation ID type: string required: false permissions: contents: read concurrency: group: ci-${{ github.workflow }}-${{ github.ref }}-${{ inputs.proof_operation || 'none' }} cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }} jobs: aws-acceptance: if: github.event_name == 'workflow_dispatch' && inputs.proof_operation != 'none' environment: dashnet-validation runs-on: ubuntu-latest timeout-minutes: 110 permissions: contents: read id-token: write steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - uses: aws-actions/configure-aws-credentials@ff717079ee2060e4bcee96c4779b553acc87447c # v4 with: role-to-assume: ${{ vars.DASHNET_PROOF_ROLE }} aws-region: ${{ vars.DASHNET_PROOF_REGION }} role-session-name: proof-${{ github.run_id }} role-duration-seconds: 7200 mask-aws-account-id: true - name: Execute pinned proof artifact with private reports env: PROOF_OPERATION: ${{ inputs.proof_operation }} PROOF_PLAN_ID: ${{ inputs.proof_plan_id }} PROOF_BUCKET: ${{ vars.DASHNET_PROOF_BUCKET }} PROOF_GROUP: ${{ vars.DASHNET_PROOF_GROUP }} PROOF_BINARY_SHA256: ${{ vars.DASHNET_PROOF_BINARY_SHA256 }} PROOF_SSH_KEY: ${{ secrets.DASHNET_PROOF_SSH_KEY }} run: bash .github/scripts/aws-acceptance.sh check: if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none' runs-on: ubuntu-latest timeout-minutes: 20 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Formatting run: test -z "$(gofmt -l cmd internal)" - name: Module integrity run: | go mod verify go mod tidy git diff --exit-code -- go.mod go.sum - name: Vet run: go vet ./... - name: Tests and race detector run: go test -race -coverprofile=coverage.out ./... - name: Prove shared claims and replay with disposable DynamoDB Local run: | set -euo pipefail docker run -d --name dashnet-journal -p 127.0.0.1:8000:8000 \ amazon/dynamodb-local:latest -jar DynamoDBLocal.jar -inMemory -sharedDb trap 'docker rm -f dashnet-journal >/dev/null' EXIT DASHNET_TEST_DYNAMODB=http://127.0.0.1:8000 DASHNET_DISPOSABLE_CI=1 \ go test -race -count=1 -v ./internal/managed -run '^TestManagedDynamoLocalClaimsAndRecovery$' # A retired network name handed to its successor, on the same real expressions. DASHNET_TEST_DYNAMODB=http://127.0.0.1:8000 DASHNET_DISPOSABLE_CI=1 \ go test -race -count=1 -v ./internal/journal -run '^TestJournalDynamoLocalNameReuse$' - name: Node worker failure-path tests run: | python3 -m unittest discover -s internal/node/testdata -p 'test_*.py' python3 -m unittest discover -s internal/managed/testdata -p 'test_*.py' python3 -m unittest discover -s internal/seedtls/testdata -p 'test_*.py' python3 .github/scripts/test_console_operation.py - name: Examples and command boundary run: | go build -trimpath -o bin/dashnet ./cmd/dashnet bin/dashnet validate --network examples/devnet.yaml bin/dashnet validate --network examples/testnet.yaml bin/dashnet validate --network examples/devnet-compute.yaml bin/dashnet validate --network examples/devnet-lifecycle.yaml for command in release-addresses join-plan join deployment-plan deploy doctor stop host-trust upgrade-plan upgrade managed-import managed-enroll managed-plan managed-deploy managed-upgrade managed-doctor managed-operation managed-unlock; do if bin/dashnet "$command"; then echo "$command accepted missing explicit intent" exit 1 fi done if bin/dashnet provision; then echo 'Provisioning accepted missing explicit intent' exit 1 fi if bin/dashnet bootstrap; then echo 'Bootstrap accepted missing plan and trusted host identity' exit 1 fi if bin/dashnet apply; then echo 'An unimplemented mutation command unexpectedly succeeded' exit 1 fi bootstrap-recipe: if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none' runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - name: Execute bootstrap recipe in disposable Ubuntu (mocked AWS and Docker) run: | docker build -t dashnet-recipe-test -f internal/bootstrap/testdata/Dockerfile . docker run --rm --network none dashnet-recipe-test # The real-Core contract (wallet, registration recovery, join) runs once per # supported Core major in core-compat.yml. platform-contract: if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none' runs-on: ubuntu-latest timeout-minutes: 25 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - name: A validator rendered by dashmate and run from its compose files run: | set -euo pipefail pin() { docker pull -q "$1" >/dev/null && docker image inspect "$1" --format '{{index .RepoDigests 0}}'; } images=$(jq -n \ --arg core "$(pin dashpay/dashd:23)" \ --arg helper "$(pin dashpay/dashmate-helper:4.2.0-beta.3)" \ --arg drive "$(pin dashpay/drive:4.2.0-beta.3)" \ --arg tenderdash "$(pin dashpay/tenderdash:1.8.0)" \ --arg dapi "$(pin dashpay/rs-dapi:4.2.0-beta.3)" \ --arg gateway "$(pin dashpay/envoy:1.39.0-impr.1)" \ --arg tor "$(pin osminogin/tor-simple:0.4.9.11@sha256:7aef2e7d957e2236d5fac7fca8e67c15fe65e6349eb90099da1cdc26bc4caa69)" \ --arg ratelimit "$(pin envoyproxy/ratelimit:3fcc3609)" \ --arg redis "$(pin redis:alpine)" \ --arg next "$(pin dashpay/rs-dapi:4.2.0-beta.6)" \ '{components: {core: $core, helper: $helper, drive: $drive, tenderdash: $tenderdash, dapi: $dapi, gateway: $gateway}, sidecars: {core_tor: $tor, gateway_rate_limiter: $ratelimit, gateway_rate_limiter_redis: $redis}, upgrade: {dapi: $next}}') sudo env PLATFORM_IMAGES="$images" DASHNET_DISPOSABLE_CI=1 python3 internal/node/testdata/platform_contract.py managed-contract: if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none' runs-on: ubuntu-latest timeout-minutes: 12 steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - name: Existing-container enrollment, replacement and interrupted deployment run: | set -euo pipefail docker pull busybox:1.36.1 before=$(docker image inspect busybox:1.36.1 --format '{{index .RepoDigests 0}}') docker pull busybox:1.37.0 after=$(docker image inspect busybox:1.37.0 --format '{{index .RepoDigests 0}}') sudo env MANAGED_FROM="$before" MANAGED_TO="$after" DASHNET_DISPOSABLE_CI=1 python3 internal/managed/testdata/contract.py binaries: if: github.event_name != 'workflow_dispatch' || inputs.proof_operation == 'none' runs-on: ubuntu-latest timeout-minutes: 20 strategy: matrix: os: [linux, darwin] arch: [amd64, arm64] steps: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6 with: go-version-file: go.mod - name: Build standalone executable env: CGO_ENABLED: '0' GOOS: ${{ matrix.os }} GOARCH: ${{ matrix.arch }} run: | mkdir -p out go build -trimpath -ldflags "-s -w -X main.version=${GITHUB_SHA}" -o "out/dashnet-${GOOS}-${GOARCH}" ./cmd/dashnet cd out sha256sum "dashnet-${GOOS}-${GOARCH}" > SHA256SUMS - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: dashnet-${{ matrix.os }}-${{ matrix.arch }} path: out/ retention-days: 14 if-no-files-found: error