From afd796c571bcd058cdbf3fd5ea1ca6900063ef8d Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 22 Mar 2022 20:47:36 -0400 Subject: [PATCH 01/12] style(ci): comply with https://json.schemastore.org/github-workflow.json Some substituions were harder to make as files were not standardized --- .github/workflows/cd.yml | 210 +++++++++++---------- .github/workflows/ci.patch.yml | 18 +- .github/workflows/ci.yml | 56 +++--- .github/workflows/clean.yml | 14 +- .github/workflows/coverage.patch.yml | 14 +- .github/workflows/coverage.yml | 34 ++-- .github/workflows/docs.yml | 114 +++++------ .github/workflows/lint.patch.yml | 12 +- .github/workflows/lint.yml | 14 +- .github/workflows/test-full-sync.yml | 44 ++--- .github/workflows/test.patch.yml | 24 +-- .github/workflows/test.yml | 64 ++++--- .github/workflows/zcash-lightwalletd.yml | 154 +++++++-------- .github/workflows/zcash-params.yml | 152 +++++++-------- .github/workflows/zcashd-manual-deploy.yml | 20 +- 15 files changed, 478 insertions(+), 466 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9ec81d56bf8..2eeb90a793d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -4,15 +4,19 @@ on: workflow_dispatch: inputs: network: - default: 'Mainnet' + default: "Mainnet" + description: "Network to deploy: Mainnet or Testnet" + required: true checkpoint_sync: - default: true + default: "true" + description: "Use as many checkpoints as possible when syncing" + required: true push: branches: - main env: - CARGO_INCREMENTAL: '1' + CARGO_INCREMENTAL: "1" NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -28,97 +32,97 @@ jobs: # timeout-minutes: 180 runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - - uses: actions/checkout@v3.0.0 - with: - persist-credentials: false - - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 - with: - short-length: 7 - - # Automatic tag management and OCI Image Format Specification for labels - - name: Docker meta - id: meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: | - ${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }} - ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.GITHUB_REF_SLUG_URL }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha - - # Setup gcloud CLI - - name: Authenticate to Google Cloud - id: auth - uses: google-github-actions/auth@v0.6.0 - with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' - - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all - - # Setup Docker Buildx to allow use of docker cache layers from GH - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Google Artifact Registry - uses: docker/login-action@v1.14.1 - with: - registry: us-docker.pkg.dev - username: oauth2accesstoken - password: ${{ steps.auth.outputs.access_token }} - - - name: Login to Google Container Registry - uses: docker/login-action@v1.14.1 - with: - registry: gcr.io - username: oauth2accesstoken - password: ${{ steps.auth.outputs.access_token }} - - # Build and push image to Google Artifact Registry - - name: Build & push - id: docker_build - uses: docker/build-push-action@v2.10.0 - with: - target: runtime - context: . - file: ./docker/Dockerfile - # TODO: building crates is taking too long with arm64 and it's timing out on GHA - # platforms: | - # linux/amd64 - # linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - NETWORK=${{ github.event.inputs.network || env.NETWORK }} - SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} - RUST_BACKTRACE=1 - ZEBRA_SKIP_IPV6_TESTS="1" - CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} - SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} - push: true - cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache - cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache,mode=max + - uses: actions/checkout@v3.0.0 + with: + persist-credentials: false + + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 + with: + short-length: 7 + + # Automatic tag management and OCI Image Format Specification for labels + - name: Docker meta + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }} + ${{ env.GCR_BASE }}/${{ env.GITHUB_REPOSITORY_SLUG_URL }}/${{ env.GITHUB_REF_SLUG_URL }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + # Setup gcloud CLI + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@v0.6.0 + with: + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all + + # Setup Docker Buildx to allow use of docker cache layers from GH + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Google Artifact Registry + uses: docker/login-action@v1.14.1 + with: + registry: us-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + - name: Login to Google Container Registry + uses: docker/login-action@v1.14.1 + with: + registry: gcr.io + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} + + # Build and push image to Google Artifact Registry + - name: Build & push + id: docker_build + uses: docker/build-push-action@v2.10.0 + with: + target: runtime + context: . + file: ./docker/Dockerfile + # TODO: building crates is taking too long with arm64 and it's timing out on GHA + # platforms: | + # linux/amd64 + # linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + NETWORK=${{ github.event.inputs.network || env.NETWORK }} + SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} + RUST_BACKTRACE=1 + ZEBRA_SKIP_IPV6_TESTS="1" + CHECKPOINT_SYNC=${{ github.event.inputs.checkpoint_sync || true }} + SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} + push: true + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.GITHUB_REF_SLUG_URL }}:buildcache,mode=max deploy-nodes: name: Deploy Mainnet nodes @@ -126,9 +130,9 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: 'read' - id-token: 'write' - if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} + contents: "read" + id-token: "write" + if: github.event_name == 'push' && github.ref_name == 'main' steps: - name: Inject slug/short variables @@ -141,9 +145,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - name: Create instance template run: | @@ -190,8 +194,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" if: github.event_name == 'workflow_dispatch' steps: @@ -205,9 +209,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" # Create instance template from container image - name: Manual deploy of a single instance running zebrad diff --git a/.github/workflows/ci.patch.yml b/.github/workflows/ci.patch.yml index 53de5032823..78652935c49 100644 --- a/.github/workflows/ci.patch.yml +++ b/.github/workflows/ci.patch.yml @@ -3,13 +3,13 @@ name: CI on: pull_request: paths-ignore: - - '**/*.rs' - - '**/*.txt' - - '**/*.snap' - - '**/Cargo.toml' - - '**/Cargo.lock' - - '**/deny.toml' - - '.github/workflows/ci.yml' + - "**/*.rs" + - "**/*.txt" + - "**/*.snap" + - "**/Cargo.toml" + - "**/Cargo.lock" + - "**/deny.toml" + - ".github/workflows/ci.yml" jobs: test: @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: # TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801 - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macos-latest] rust: [stable] steps: @@ -72,4 +72,4 @@ jobs: continue-on-error: ${{ matrix.checks == 'advisories' }} steps: - - run: 'echo "No build required"' \ No newline at end of file + - run: 'echo "No build required"' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daa5bc9e782..71a2f06c6eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,23 +5,23 @@ on: pull_request: paths: # code and tests - - '**/*.rs' + - "**/*.rs" # hard-coded checkpoints and proptest regressions - - '**/*.txt' + - "**/*.txt" # test data snapshots - - '**/*.snap' + - "**/*.snap" # dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' - - '**/deny.toml' + - "**/Cargo.toml" + - "**/Cargo.lock" + - "**/deny.toml" # workflow definitions - - '.github/workflows/ci.yml' + - ".github/workflows/ci.yml" env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: '1' + COLORBT_SHOW_HIDDEN: "1" jobs: test: @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: # TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801 - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macos-latest] rust: [stable] steps: @@ -67,7 +67,7 @@ jobs: # Ubuntu runners don't have reliable network or DNS during test steps. # Windows runners have an unreliable network. shell: bash - if: matrix.os != 'macOS-latest' + if: matrix.os != 'macos-latest' run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV - name: Minimise proptest cases on macOS and Windows @@ -79,8 +79,8 @@ jobs: shell: bash if: matrix.os != 'ubuntu-latest' run: | - echo "PROPTEST_CASES=1" >> $GITHUB_ENV - echo "PROPTEST_MAX_SHRINK_ITERS=1024" >> $GITHUB_ENV + echo "PROPTEST_CASES=1" >> $GITHUB_ENV + echo "PROPTEST_MAX_SHRINK_ITERS=1024" >> $GITHUB_ENV - name: Change target output directory on Windows # Windows doesn't have enough space on the D: drive, so we redirect the build output to the @@ -118,7 +118,7 @@ jobs: - name: Run zebrad large sync tests # Skip the entire step on Ubuntu and Windows, because the test would be skipped anyway due to ZEBRA_SKIP_NETWORK_TESTS - if: matrix.os == 'macOS-latest' + if: matrix.os == 'macos-latest' uses: actions-rs/cargo@v1.0.3 with: command: test @@ -245,18 +245,18 @@ jobs: continue-on-error: ${{ matrix.checks == 'advisories' }} steps: - - uses: actions/checkout@v2 - with: - persist-credentials: false - - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check ${{ matrix.checks }} - args: --all-features --workspace - - # this check runs with optional features off - # so we expect some warnings about "skip tree root was not found" - - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check ${{ matrix.checks }} - args: --workspace + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check ${{ matrix.checks }} + args: --all-features --workspace + + # this check runs with optional features off + # so we expect some warnings about "skip tree root was not found" + - uses: EmbarkStudios/cargo-deny-action@v1 + with: + command: check ${{ matrix.checks }} + args: --workspace diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index e5c961b9de0..ca85a221525 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -5,7 +5,7 @@ on: pull_request: branches: - main - types: [ closed ] + types: [closed] env: NETWORK: Mainnet @@ -18,8 +18,8 @@ jobs: name: Delete test deployments runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -31,12 +31,12 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - name: Delete test instance continue-on-error: true run: | TEST_INSTANCES=$(gcloud compute instances list --filter="${{ env.GITHUB_REF_SLUG_URL }}" --format='value(NAME)') - for instance in ${TEST_INSTANCES}; do gcloud compute instances delete $instance --zone "${{ env.ZONE }}" --delete-disks all --quiet; done \ No newline at end of file + for instance in ${TEST_INSTANCES}; do gcloud compute instances delete $instance --zone "${{ env.ZONE }}" --delete-disks all --quiet; done diff --git a/.github/workflows/coverage.patch.yml b/.github/workflows/coverage.patch.yml index 325fb16418d..61c22d0f90b 100644 --- a/.github/workflows/coverage.patch.yml +++ b/.github/workflows/coverage.patch.yml @@ -3,13 +3,13 @@ name: Coverage on: pull_request: paths-ignore: - - '**/*.rs' - - '**/*.txt' - - '**/*.snap' - - '**/Cargo.toml' - - '**/Cargo.lock' - - 'codecov.yml' - - '.github/workflows/coverage.yml' + - "**/*.rs" + - "**/*.txt" + - "**/*.snap" + - "**/Cargo.toml" + - "**/Cargo.lock" + - "codecov.yml" + - ".github/workflows/coverage.yml" jobs: coverage: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9b67a1ca46b..40084e2b44b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,32 +7,32 @@ on: - main paths: # code and tests - - '**/*.rs' + - "**/*.rs" # hard-coded checkpoints and proptest regressions - - '**/*.txt' + - "**/*.txt" # test data snapshots - - '**/*.snap' + - "**/*.snap" # dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' + - "**/Cargo.toml" + - "**/Cargo.lock" # workflow definitions - - 'codecov.yml' - - '.github/workflows/coverage.yml' + - "codecov.yml" + - ".github/workflows/coverage.yml" pull_request: paths: - - '**/*.rs' - - '**/*.txt' - - '**/*.snap' - - '**/Cargo.toml' - - '**/Cargo.lock' - - 'codecov.yml' - - '.github/workflows/coverage.yml' + - "**/*.rs" + - "**/*.txt" + - "**/*.snap" + - "**/Cargo.toml" + - "**/Cargo.lock" + - "codecov.yml" + - ".github/workflows/coverage.yml" env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: '1' + COLORBT_SHOW_HIDDEN: "1" jobs: coverage: @@ -70,8 +70,8 @@ jobs: # Coverage tests are much slower than other tests, particularly in hot loops. shell: bash run: | - echo "PROPTEST_CASES=1" >> $GITHUB_ENV - echo "PROPTEST_MAX_SHRINK_ITERS=0" >> $GITHUB_ENV + echo "PROPTEST_CASES=1" >> $GITHUB_ENV + echo "PROPTEST_MAX_SHRINK_ITERS=0" >> $GITHUB_ENV # Modified from: # https://github.com/zcash/librustzcash/blob/c48bb4def2e122289843ddb3cb2984c325c03ca0/.github/workflows/ci.yml#L20-L33 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index df2212949f7..1ef5005f252 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,15 +7,15 @@ on: - main paths: # doc source files - - 'book/**' - - '**/firebase.json' - - 'katex-header.html' + - "book/**" + - "**/firebase.json" + - "katex-header.html" # rustdoc source files - - '**/*.rs' - - '**/Cargo.toml' - - '**/Cargo.lock' + - "**/*.rs" + - "**/Cargo.toml" + - "**/Cargo.lock" # workflow definitions - - '.github/workflows/docs.yml' + - ".github/workflows/docs.yml" jobs: build: @@ -23,62 +23,62 @@ jobs: timeout-minutes: 30 runs-on: ubuntu-latest steps: - - name: Checkout the source code - uses: actions/checkout@v3.0.0 - with: - persist-credentials: false + - name: Checkout the source code + uses: actions/checkout@v3.0.0 + with: + persist-credentials: false - - name: Install latest beta - uses: actions-rs/toolchain@v1 - with: - toolchain: beta - components: rust-docs - override: true + - name: Install latest beta + uses: actions-rs/toolchain@v1 + with: + toolchain: beta + components: rust-docs + override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v1 - - name: Install mdbook - run: | - cargo install mdbook + - name: Install mdbook + run: | + cargo install mdbook - - name: Build Zebra book - run: | - mdbook build book/ + - name: Build Zebra book + run: | + mdbook build book/ - - name: Deploy Zebra book to firebase - uses: w9jds/firebase-action@v2.0.0 - with: - args: deploy - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - PROJECT_PATH: book/ - PROJECT_ID: zebra-book-b535f + - name: Deploy Zebra book to firebase + uses: w9jds/firebase-action@v2.0.0 + with: + args: deploy + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + PROJECT_PATH: book/ + PROJECT_ID: zebra-book-b535f - - name: Build external docs - run: | - # Exclude zebra-utils, it is not for library or app users - cargo doc --no-deps --workspace --exclude zebra-utils - env: - RUSTDOCFLAGS: "--html-in-header katex-header.html" + - name: Build external docs + run: | + # Exclude zebra-utils, it is not for library or app users + cargo doc --no-deps --workspace --exclude zebra-utils + env: + RUSTDOCFLAGS: "--html-in-header katex-header.html" - - name: Deploy external docs to firebase - uses: w9jds/firebase-action@v2.0.0 - with: - args: deploy - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - PROJECT_ID: zebra-doc-external + - name: Deploy external docs to firebase + uses: w9jds/firebase-action@v2.0.0 + with: + args: deploy + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + PROJECT_ID: zebra-doc-external - - name: Build internal docs - run: | - cargo doc --no-deps --document-private-items - env: - RUSTDOCFLAGS: "--html-in-header katex-header.html" + - name: Build internal docs + run: | + cargo doc --no-deps --document-private-items + env: + RUSTDOCFLAGS: "--html-in-header katex-header.html" - - name: Deploy internal docs to firebase - uses: w9jds/firebase-action@v2.0.0 - with: - args: deploy - env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - PROJECT_ID: zebra-doc-internal-e9fd4 + - name: Deploy internal docs to firebase + uses: w9jds/firebase-action@v2.0.0 + with: + args: deploy + env: + FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + PROJECT_ID: zebra-doc-internal-e9fd4 diff --git a/.github/workflows/lint.patch.yml b/.github/workflows/lint.patch.yml index 340423d6f7b..85667a8089b 100644 --- a/.github/workflows/lint.patch.yml +++ b/.github/workflows/lint.patch.yml @@ -6,12 +6,12 @@ on: - "**" - "!main" paths-ignore: - - '**/*.rs' - - '**/Cargo.toml' - - '**/Cargo.lock' - - 'clippy.toml' - - '.cargo/config.toml' - - '.github/workflows/lint.yml' + - "**/*.rs" + - "**/Cargo.toml" + - "**/Cargo.lock" + - "clippy.toml" + - ".cargo/config.toml" + - ".github/workflows/lint.yml" jobs: clippy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7f57dacad54..1c9aecb614b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,20 +7,20 @@ on: - "!main" paths: # code and tests - - '**/*.rs' + - "**/*.rs" # dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' + - "**/Cargo.toml" + - "**/Cargo.lock" # workflow definitions - - 'clippy.toml' - - '.cargo/config.toml' - - '.github/workflows/lint.yml' + - "clippy.toml" + - ".cargo/config.toml" + - ".github/workflows/lint.yml" env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: '1' + COLORBT_SHOW_HIDDEN: "1" jobs: clippy: diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index a0885f42913..b83d8780df9 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -4,30 +4,32 @@ on: workflow_dispatch: inputs: network: - default: 'Mainnet' + default: "Mainnet" + description: "Network to deploy: Mainnet or Testnet" + required: true pull_request: branches: - main paths: # code and tests (including full sync acceptance test changes) # TODO: ignore changes in test code that isn't used in the full sync test - - '**/*.rs' + - "**/*.rs" # hard-coded checkpoints # TODO: ignore changes to proptest seed .txt files - - '**/*.txt' + - "**/*.txt" # dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' + - "**/Cargo.toml" + - "**/Cargo.lock" # workflow definitions - - 'docker/**' - - '.github/workflows/test-full-sync.yml' + - "docker/**" + - ".github/workflows/test-full-sync.yml" env: - CARGO_INCREMENTAL: '1' + CARGO_INCREMENTAL: "1" ZEBRA_SKIP_IPV6_TESTS: "1" RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: '1' + COLORBT_SHOW_HIDDEN: "1" NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -41,13 +43,13 @@ jobs: build: # only run on Mergify head branches, and on manual dispatch: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-your-workflow-based-on-the-head-or-base-branch-of-a-pull-request-1 - if: startsWith(github.head_ref, 'mergify/merge-queue/') || github.event_name == 'workflow_dispatch' + if: startsWith(github.head_ref, 'mergify/merge-queue/') || github.event_name == 'workflow_dispatch' name: Build images timeout-minutes: 210 runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - uses: actions/checkout@v3.0.0 with: @@ -86,9 +88,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 @@ -132,10 +134,10 @@ jobs: test-full-sync: name: Test full Mainnet sync runs-on: ubuntu-latest - needs: [ build ] + needs: [build] permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -147,9 +149,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA diff --git a/.github/workflows/test.patch.yml b/.github/workflows/test.patch.yml index 0b0b89dd0d7..d3cc0c0b6fc 100644 --- a/.github/workflows/test.patch.yml +++ b/.github/workflows/test.patch.yml @@ -5,13 +5,13 @@ on: branches: - main paths-ignore: - - '**/*.rs' - - '**/*.txt' - - '**/*.snap' - - '**/Cargo.toml' - - '**/Cargo.lock' - - 'docker/**' - - '.github/workflows/test.yml' + - "**/*.rs" + - "**/*.txt" + - "**/*.snap" + - "**/Cargo.toml" + - "**/Cargo.lock" + - "docker/**" + - ".github/workflows/test.yml" jobs: build: @@ -25,7 +25,7 @@ jobs: name: Test all runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' }} + if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -33,7 +33,7 @@ jobs: name: Test with fake activation heights runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' }} + if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -42,7 +42,7 @@ jobs: name: Test checkpoint sync from empty state runs-on: ubuntu-latest needs: build - if: ${{ github.event.inputs.regenerate-disks != 'true' }} + if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -59,6 +59,6 @@ jobs: test-stateful-sync: name: Test full validation sync from cached state runs-on: ubuntu-latest - needs: [ build, regenerate-stateful-disks] + needs: [build, regenerate-stateful-disks] steps: - - run: 'echo "No build required"' \ No newline at end of file + - run: 'echo "No build required"' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e13af4c8280..25dcdcdf5bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,34 +4,36 @@ on: workflow_dispatch: inputs: network: - default: 'Mainnet' + default: "Mainnet" + description: "Network to deploy: Mainnet or Testnet" + required: true regenerate-disks: type: boolean default: false - description: Just update stateful disks + description: "Just update stateful disks" pull_request: branches: - main paths: # code and tests - - '**/*.rs' + - "**/*.rs" # hard-coded checkpoints and proptest regressions - - '**/*.txt' + - "**/*.txt" # test data snapshots - - '**/*.snap' + - "**/*.snap" # dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' + - "**/Cargo.toml" + - "**/Cargo.lock" # workflow definitions - - 'docker/**' - - '.github/workflows/test.yml' + - "docker/**" + - ".github/workflows/test.yml" env: - CARGO_INCREMENTAL: '1' - ZEBRA_SKIP_IPV6_TESTS: '1' + CARGO_INCREMENTAL: "1" + ZEBRA_SKIP_IPV6_TESTS: "1" RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: '1' + COLORBT_SHOW_HIDDEN: "1" NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -47,8 +49,8 @@ jobs: timeout-minutes: 210 runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - uses: actions/checkout@v3.0.0 with: @@ -87,9 +89,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 @@ -167,7 +169,7 @@ jobs: docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} docker run -e ZEBRA_SKIP_IPV6_TESTS -e TEST_FAKE_ACTIVATION_HEIGHTS --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --package zebra-state --lib -- with_fake_activation_heights env: - TEST_FAKE_ACTIVATION_HEIGHTS: '1' + TEST_FAKE_ACTIVATION_HEIGHTS: "1" # Test that Zebra syncs and checkpoints a few thousand blocks from an empty state test-empty-sync: @@ -202,7 +204,7 @@ jobs: docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} docker run -e ZEBRA_SKIP_IPV6_TESTS -e ZEBRA_TEST_LIGHTWALLETD --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features enable-sentry --test acceptance -- lightwalletd_integration --nocapture env: - ZEBRA_TEST_LIGHTWALLETD: '1' + ZEBRA_TEST_LIGHTWALLETD: "1" regenerate-stateful-disks: name: Regenerate stateful disks @@ -211,13 +213,13 @@ jobs: outputs: any_changed: ${{ steps.changed-files-specific.outputs.any_changed }} permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - uses: actions/checkout@v3.0.0 with: persist-credentials: false - fetch-depth: '2' + fetch-depth: "2" # only run this job if the database format might have changed - name: Get specific changed files @@ -254,9 +256,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA @@ -355,10 +357,10 @@ jobs: test-stateful-sync: name: Test full validation sync from cached state runs-on: ubuntu-latest - needs: [ build, regenerate-stateful-disks] + needs: [build, regenerate-stateful-disks] permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -374,9 +376,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index 1c01ce000ff..fd3603c8600 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -4,21 +4,21 @@ on: workflow_dispatch: push: branches: - - 'main' + - "main" paths: # rebuild lightwalletd whenever the related Zebra code changes # # TODO: this code isn't compiled in this docker image # rebuild whenever the actual code at adityapk00/lightwalletd/master changes - - 'zebra-rpc/**' - - 'zebrad/tests/acceptance.rs' - - 'zebrad/src/config.rs' - - 'zebrad/src/commands/start.rs' + - "zebra-rpc/**" + - "zebrad/tests/acceptance.rs" + - "zebrad/src/config.rs" + - "zebrad/src/commands/start.rs" # workflow definitions # # unlike the Zebra code, these workflow definitions do change the docker image - - 'docker/zcash-lightwalletd/Dockerfile' - - '.github/workflows/zcash-lightwalletd.yml' + - "docker/zcash-lightwalletd/Dockerfile" + - ".github/workflows/zcash-lightwalletd.yml" env: PROJECT_ID: zealous-zebra @@ -31,85 +31,85 @@ jobs: name: Build images runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - - uses: actions/checkout@v3.0.0 - with: - repository: adityapk00/lightwalletd - ref: 'master' - persist-credentials: false + - uses: actions/checkout@v3.0.0 + with: + repository: adityapk00/lightwalletd + ref: "master" + persist-credentials: false - - uses: actions/checkout@v3.0.0 - with: - path: zebra - persist-credentials: false + - uses: actions/checkout@v3.0.0 + with: + path: zebra + persist-credentials: false - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 with: short-length: 7 - # Automatic tag management and OCI Image Format Specification for labels - - name: Docker meta - id: meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: | - ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha + # Automatic tag management and OCI Image Format Specification for labels + - name: Docker meta + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all - # Setup Docker Buildx to allow use of docker cache layers from GH - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 + # Setup Docker Buildx to allow use of docker cache layers from GH + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 - # Setup gcloud CLI - - name: Authenticate to Google Cloud - id: auth - uses: google-github-actions/auth@v0.6.0 - with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + # Setup gcloud CLI + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@v0.6.0 + with: + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - - name: Login to Google Artifact Registry - uses: docker/login-action@v1.14.1 - with: - registry: us-docker.pkg.dev - username: oauth2accesstoken - password: ${{ steps.auth.outputs.access_token }} + - name: Login to Google Artifact Registry + uses: docker/login-action@v1.14.1 + with: + registry: us-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} - # Build and push image to Google Artifact Registry - - name: Build & push - id: docker_build - uses: docker/build-push-action@v2.10.0 - with: - target: build - context: . - file: ./zebra/docker/zcash-lightwalletd/Dockerfile - platforms: | - linux/amd64 - linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true - cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + # Build and push image to Google Artifact Registry + - name: Build & push + id: docker_build + uses: docker/build-push-action@v2.10.0 + with: + target: build + context: . + file: ./zebra/docker/zcash-lightwalletd/Dockerfile + platforms: | + linux/amd64 + linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + push: true + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max diff --git a/.github/workflows/zcash-params.yml b/.github/workflows/zcash-params.yml index 61e1484b0a8..f3d2fe2c70a 100644 --- a/.github/workflows/zcash-params.yml +++ b/.github/workflows/zcash-params.yml @@ -4,18 +4,18 @@ on: workflow_dispatch: push: branches: - - 'main' + - "main" paths: # parameter download code - - 'zebra-consensus/src/primitives/groth16/params.rs' - - 'zebra-consensus/src/chain.rs' - - 'zebrad/src/commands/start.rs' + - "zebra-consensus/src/primitives/groth16/params.rs" + - "zebra-consensus/src/chain.rs" + - "zebrad/src/commands/start.rs" # workflow definitions - - 'docker/zcash-params/Dockerfile' - - '.github/workflows/zcash-params.yml' + - "docker/zcash-params/Dockerfile" + - ".github/workflows/zcash-params.yml" env: - CARGO_INCREMENTAL: '1' + CARGO_INCREMENTAL: "1" PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra GCR_BASE: gcr.io/zealous-zebra @@ -28,84 +28,84 @@ jobs: # timeout-minutes: 180 runs-on: ubuntu-latest permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - - uses: actions/checkout@v3.0.0 - with: - persist-credentials: false + - uses: actions/checkout@v3.0.0 + with: + persist-credentials: false - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 + - name: Inject slug/short variables + uses: rlespinasse/github-slug-action@v4 with: short-length: 7 - # Automatic tag management and OCI Image Format Specification for labels - - name: Docker meta - id: meta - uses: docker/metadata-action@v3.6.2 - with: - # list of Docker images to use as base name for tags - images: | - ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} - # generate Docker tags based on the following events/attributes - tags: | - type=schedule - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=sha + # Automatic tag management and OCI Image Format Specification for labels + - name: Docker meta + id: meta + uses: docker/metadata-action@v3.6.2 + with: + # list of Docker images to use as base name for tags + images: | + ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v1 - with: - image: tonistiigi/binfmt:latest - platforms: all + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all - # Setup Docker Buildx to allow use of docker cache layers from GH - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 + # Setup Docker Buildx to allow use of docker cache layers from GH + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 - # Setup gcloud CLI - - name: Authenticate to Google Cloud - id: auth - uses: google-github-actions/auth@v0.6.0 - with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + # Setup gcloud CLI + - name: Authenticate to Google Cloud + id: auth + uses: google-github-actions/auth@v0.6.0 + with: + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" - - name: Login to Google Artifact Registry - uses: docker/login-action@v1.14.1 - with: - registry: us-docker.pkg.dev - username: oauth2accesstoken - password: ${{ steps.auth.outputs.access_token }} + - name: Login to Google Artifact Registry + uses: docker/login-action@v1.14.1 + with: + registry: us-docker.pkg.dev + username: oauth2accesstoken + password: ${{ steps.auth.outputs.access_token }} - # Build and push image to Google Artifact Registry - - name: Build & push - id: docker_build - uses: docker/build-push-action@v2.10.0 - with: - target: builder - context: . - file: ./docker/zcash-params/Dockerfile - # TODO: building crates is taking too long with arm64 and it's timing out on GHA - # platforms: | - # linux/amd64 - # linux/arm64 + # Build and push image to Google Artifact Registry + - name: Build & push + id: docker_build + uses: docker/build-push-action@v2.10.0 + with: + target: builder + context: . + file: ./docker/zcash-params/Dockerfile + # TODO: building crates is taking too long with arm64 and it's timing out on GHA + # platforms: | + # linux/amd64 + # linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} - ZEBRA_SKIP_IPV6_TESTS="1" - SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} - push: true - cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + SHORT_SHA=${{ env.GITHUB_SHA_SHORT }} + ZEBRA_SKIP_IPV6_TESTS="1" + SENTRY_DSN=${{ secrets.SENTRY_ENDPOINT }} + push: true + cache-from: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache + cache-to: type=registry,ref=${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max diff --git a/.github/workflows/zcashd-manual-deploy.yml b/.github/workflows/zcashd-manual-deploy.yml index 399c305f71d..15537423f86 100644 --- a/.github/workflows/zcashd-manual-deploy.yml +++ b/.github/workflows/zcashd-manual-deploy.yml @@ -4,9 +4,13 @@ on: workflow_dispatch: inputs: network: - default: 'Testnet' + default: "Mainnet" + description: "Network to deploy: Mainnet or Testnet" + required: true size: - default: 10 + default: "10" + description: "GCP Managed Instance Group size" + required: true env: PROJECT_ID: zealous-zebra @@ -20,8 +24,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: 'read' - id-token: 'write' + contents: "read" + id-token: "write" steps: - uses: actions/checkout@v3.0.0 @@ -38,9 +42,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' - service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' - token_format: 'access_token' + workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" + service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" + token_format: "access_token" # Create instance template from container image - name: Create instance template @@ -81,4 +85,4 @@ jobs: gcloud compute instance-groups managed rolling-action start-update \ "zcashd-${{ env.GITHUB_REF_SLUG_URL }}-${{ github.event.inputs.network }}" \ --version template="zcashd-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}" \ - --region "${{ env.REGION }}" \ No newline at end of file + --region "${{ env.REGION }}" From c522d62f3951b1c6ef6727d081e978e2d56ef476 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 22 Mar 2022 21:20:03 -0400 Subject: [PATCH 02/12] fix(mergify): use correct name for macos --- .github/mergify.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index ae83f6daa76..a71ed2bd182 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -10,7 +10,7 @@ queue_rules: - check-success=Test full validation sync from cached state - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest - check-success=Test stable on ubuntu-latest - - check-success=Test stable on macOS-latest + - check-success=Test stable on macos-latest # TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801 # - check-success=Test stable on windows-latest - check-success=Clippy @@ -27,7 +27,7 @@ queue_rules: - check-success=Test full validation sync from cached state - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest - check-success=Test stable on ubuntu-latest - - check-success=Test stable on macOS-latest + - check-success=Test stable on macos-latest # - check-success=Test stable on windows-latest - check-success=Clippy - check-success=Rustfmt @@ -43,7 +43,7 @@ queue_rules: - check-success=Test full validation sync from cached state - check-success=Test stable zebra-state with fake activation heights on ubuntu-latest - check-success=Test stable on ubuntu-latest - - check-success=Test stable on macOS-latest + - check-success=Test stable on macos-latest # - check-success=Test stable on windows-latest - check-success=Clippy - check-success=Rustfmt From 27b170065b9ca8412bb431000af694b84412b357 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 23 Mar 2022 06:44:03 -0400 Subject: [PATCH 03/12] style(actions): revert to single quotes --- .github/workflows/cd.yml | 40 +++++++------- .github/workflows/ci.patch.yml | 14 ++--- .github/workflows/ci.yml | 18 +++---- .github/workflows/clean.yml | 10 ++-- .github/workflows/coverage.patch.yml | 14 ++--- .github/workflows/coverage.yml | 30 +++++------ .github/workflows/docs.yml | 18 +++---- .github/workflows/lint.patch.yml | 16 +++--- .github/workflows/lint.yml | 18 +++---- .github/workflows/test-full-sync.yml | 42 +++++++-------- .github/workflows/test.patch.yml | 14 ++--- .github/workflows/test.yml | 63 +++++++++++----------- .github/workflows/zcash-lightwalletd.yml | 26 ++++----- .github/workflows/zcash-params.yml | 24 ++++----- .github/workflows/zcashd-manual-deploy.yml | 18 +++---- 15 files changed, 183 insertions(+), 182 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2eeb90a793d..9fd401f160c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -4,19 +4,19 @@ on: workflow_dispatch: inputs: network: - default: "Mainnet" - description: "Network to deploy: Mainnet or Testnet" + default: 'Mainnet' + description: 'Network to deploy: Mainnet or Testnet' required: true checkpoint_sync: - default: "true" - description: "Use as many checkpoints as possible when syncing" + default: 'true' + description: 'Use as many checkpoints as possible when syncing' required: true push: branches: - main env: - CARGO_INCREMENTAL: "1" + CARGO_INCREMENTAL: '1' NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -32,8 +32,8 @@ jobs: # timeout-minutes: 180 runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 @@ -69,9 +69,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Set up QEMU id: qemu @@ -130,8 +130,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' if: github.event_name == 'push' && github.ref_name == 'main' steps: @@ -145,9 +145,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Create instance template run: | @@ -194,8 +194,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' if: github.event_name == 'workflow_dispatch' steps: @@ -209,9 +209,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' # Create instance template from container image - name: Manual deploy of a single instance running zebrad diff --git a/.github/workflows/ci.patch.yml b/.github/workflows/ci.patch.yml index 78652935c49..545d1d5eac8 100644 --- a/.github/workflows/ci.patch.yml +++ b/.github/workflows/ci.patch.yml @@ -3,13 +3,13 @@ name: CI on: pull_request: paths-ignore: - - "**/*.rs" - - "**/*.txt" - - "**/*.snap" - - "**/Cargo.toml" - - "**/Cargo.lock" - - "**/deny.toml" - - ".github/workflows/ci.yml" + - '**/*.rs' + - '**/*.txt' + - '**/*.snap' + - '**/Cargo.toml' + - '**/Cargo.lock' + - '**/deny.toml' + - '.github/workflows/ci.yml' jobs: test: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71a2f06c6eb..1b03732b075 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,23 +5,23 @@ on: pull_request: paths: # code and tests - - "**/*.rs" + - '**/*.rs' # hard-coded checkpoints and proptest regressions - - "**/*.txt" + - '**/*.txt' # test data snapshots - - "**/*.snap" + - '**/*.snap' # dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" - - "**/deny.toml" + - '**/Cargo.toml' + - '**/Cargo.lock' + - '**/deny.toml' # workflow definitions - - ".github/workflows/ci.yml" + - '.github/workflows/ci.yml' env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: "1" + COLORBT_SHOW_HIDDEN: '1' jobs: test: @@ -159,7 +159,7 @@ jobs: - name: Run tests with fake activation heights uses: actions-rs/cargo@v1.0.3 env: - TEST_FAKE_ACTIVATION_HEIGHTS: "" + TEST_FAKE_ACTIVATION_HEIGHTS: '' with: command: test # Note: this only runs the zebra-state crate tests, diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index ca85a221525..adbbb437eb3 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -18,8 +18,8 @@ jobs: name: Delete test deployments runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -31,9 +31,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Delete test instance continue-on-error: true diff --git a/.github/workflows/coverage.patch.yml b/.github/workflows/coverage.patch.yml index 61c22d0f90b..325fb16418d 100644 --- a/.github/workflows/coverage.patch.yml +++ b/.github/workflows/coverage.patch.yml @@ -3,13 +3,13 @@ name: Coverage on: pull_request: paths-ignore: - - "**/*.rs" - - "**/*.txt" - - "**/*.snap" - - "**/Cargo.toml" - - "**/Cargo.lock" - - "codecov.yml" - - ".github/workflows/coverage.yml" + - '**/*.rs' + - '**/*.txt' + - '**/*.snap' + - '**/Cargo.toml' + - '**/Cargo.lock' + - 'codecov.yml' + - '.github/workflows/coverage.yml' jobs: coverage: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 40084e2b44b..b0f8c056a17 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -7,32 +7,32 @@ on: - main paths: # code and tests - - "**/*.rs" + - '**/*.rs' # hard-coded checkpoints and proptest regressions - - "**/*.txt" + - '**/*.txt' # test data snapshots - - "**/*.snap" + - '**/*.snap' # dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" + - '**/Cargo.toml' + - '**/Cargo.lock' # workflow definitions - - "codecov.yml" - - ".github/workflows/coverage.yml" + - 'codecov.yml' + - '.github/workflows/coverage.yml' pull_request: paths: - - "**/*.rs" - - "**/*.txt" - - "**/*.snap" - - "**/Cargo.toml" - - "**/Cargo.lock" - - "codecov.yml" - - ".github/workflows/coverage.yml" + - '**/*.rs' + - '**/*.txt' + - '**/*.snap' + - '**/Cargo.toml' + - '**/Cargo.lock' + - 'codecov.yml' + - '.github/workflows/coverage.yml' env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: "1" + COLORBT_SHOW_HIDDEN: '1' jobs: coverage: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1ef5005f252..9f3901c19c7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,15 +7,15 @@ on: - main paths: # doc source files - - "book/**" - - "**/firebase.json" - - "katex-header.html" + - 'book/**' + - '**/firebase.json' + - 'katex-header.html' # rustdoc source files - - "**/*.rs" - - "**/Cargo.toml" - - "**/Cargo.lock" + - '**/*.rs' + - '**/Cargo.toml' + - '**/Cargo.lock' # workflow definitions - - ".github/workflows/docs.yml" + - '.github/workflows/docs.yml' jobs: build: @@ -59,7 +59,7 @@ jobs: # Exclude zebra-utils, it is not for library or app users cargo doc --no-deps --workspace --exclude zebra-utils env: - RUSTDOCFLAGS: "--html-in-header katex-header.html" + RUSTDOCFLAGS: '--html-in-header katex-header.html' - name: Deploy external docs to firebase uses: w9jds/firebase-action@v2.0.0 @@ -73,7 +73,7 @@ jobs: run: | cargo doc --no-deps --document-private-items env: - RUSTDOCFLAGS: "--html-in-header katex-header.html" + RUSTDOCFLAGS: '--html-in-header katex-header.html' - name: Deploy internal docs to firebase uses: w9jds/firebase-action@v2.0.0 diff --git a/.github/workflows/lint.patch.yml b/.github/workflows/lint.patch.yml index 85667a8089b..cb37a5e3857 100644 --- a/.github/workflows/lint.patch.yml +++ b/.github/workflows/lint.patch.yml @@ -3,15 +3,15 @@ name: Lint Rust files on: push: branches: - - "**" - - "!main" + - '**' + - '!main' paths-ignore: - - "**/*.rs" - - "**/Cargo.toml" - - "**/Cargo.lock" - - "clippy.toml" - - ".cargo/config.toml" - - ".github/workflows/lint.yml" + - '**/*.rs' + - '**/Cargo.toml' + - '**/Cargo.lock' + - 'clippy.toml' + - '.cargo/config.toml' + - '.github/workflows/lint.yml' jobs: clippy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1c9aecb614b..7da443026b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,24 +3,24 @@ name: Lint Rust files on: push: branches: - - "**" - - "!main" + - '**' + - '!main' paths: # code and tests - - "**/*.rs" + - '**/*.rs' # dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" + - '**/Cargo.toml' + - '**/Cargo.lock' # workflow definitions - - "clippy.toml" - - ".cargo/config.toml" - - ".github/workflows/lint.yml" + - 'clippy.toml' + - '.cargo/config.toml' + - '.github/workflows/lint.yml' env: CARGO_INCREMENTAL: 0 RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: "1" + COLORBT_SHOW_HIDDEN: '1' jobs: clippy: diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index b83d8780df9..cb563471acf 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -4,8 +4,8 @@ on: workflow_dispatch: inputs: network: - default: "Mainnet" - description: "Network to deploy: Mainnet or Testnet" + default: 'Mainnet' + description: 'Network to deploy: Mainnet or Testnet' required: true pull_request: branches: @@ -13,23 +13,23 @@ on: paths: # code and tests (including full sync acceptance test changes) # TODO: ignore changes in test code that isn't used in the full sync test - - "**/*.rs" + - '**/*.rs' # hard-coded checkpoints # TODO: ignore changes to proptest seed .txt files - - "**/*.txt" + - '**/*.txt' # dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" + - '**/Cargo.toml' + - '**/Cargo.lock' # workflow definitions - - "docker/**" - - ".github/workflows/test-full-sync.yml" + - 'docker/**' + - '.github/workflows/test-full-sync.yml' env: - CARGO_INCREMENTAL: "1" - ZEBRA_SKIP_IPV6_TESTS: "1" + CARGO_INCREMENTAL: '1' + ZEBRA_SKIP_IPV6_TESTS: '1' RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: "1" + COLORBT_SHOW_HIDDEN: '1' NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -48,8 +48,8 @@ jobs: timeout-minutes: 210 runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 with: @@ -88,9 +88,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 @@ -136,8 +136,8 @@ jobs: runs-on: ubuntu-latest needs: [build] permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -149,9 +149,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA diff --git a/.github/workflows/test.patch.yml b/.github/workflows/test.patch.yml index d3cc0c0b6fc..22c82dfa53e 100644 --- a/.github/workflows/test.patch.yml +++ b/.github/workflows/test.patch.yml @@ -5,13 +5,13 @@ on: branches: - main paths-ignore: - - "**/*.rs" - - "**/*.txt" - - "**/*.snap" - - "**/Cargo.toml" - - "**/Cargo.lock" - - "docker/**" - - ".github/workflows/test.yml" + - '**/*.rs' + - '**/*.txt' + - '**/*.snap' + - '**/Cargo.toml' + - '**/Cargo.lock' + - 'docker/**' + - '.github/workflows/test.yml' jobs: build: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 25dcdcdf5bf..f58369b2b18 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,36 +4,37 @@ on: workflow_dispatch: inputs: network: - default: "Mainnet" - description: "Network to deploy: Mainnet or Testnet" + default: 'Mainnet' + description: 'Network to deploy: Mainnet or Testnet' required: true regenerate-disks: type: boolean default: false - description: "Just update stateful disks" + description: 'Just update stateful disks' + required: true pull_request: branches: - main paths: # code and tests - - "**/*.rs" + - '**/*.rs' # hard-coded checkpoints and proptest regressions - - "**/*.txt" + - '**/*.txt' # test data snapshots - - "**/*.snap" + - '**/*.snap' # dependencies - - "**/Cargo.toml" - - "**/Cargo.lock" + - '**/Cargo.toml' + - '**/Cargo.lock' # workflow definitions - - "docker/**" - - ".github/workflows/test.yml" + - 'docker/**' + - '.github/workflows/test.yml' env: - CARGO_INCREMENTAL: "1" - ZEBRA_SKIP_IPV6_TESTS: "1" + CARGO_INCREMENTAL: '1' + ZEBRA_SKIP_IPV6_TESTS: '1' RUST_BACKTRACE: full RUST_LIB_BACKTRACE: full - COLORBT_SHOW_HIDDEN: "1" + COLORBT_SHOW_HIDDEN: '1' NETWORK: Mainnet PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra @@ -49,8 +50,8 @@ jobs: timeout-minutes: 210 runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 with: @@ -89,9 +90,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 @@ -169,7 +170,7 @@ jobs: docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} docker run -e ZEBRA_SKIP_IPV6_TESTS -e TEST_FAKE_ACTIVATION_HEIGHTS --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --package zebra-state --lib -- with_fake_activation_heights env: - TEST_FAKE_ACTIVATION_HEIGHTS: "1" + TEST_FAKE_ACTIVATION_HEIGHTS: '1' # Test that Zebra syncs and checkpoints a few thousand blocks from an empty state test-empty-sync: @@ -204,7 +205,7 @@ jobs: docker pull ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} docker run -e ZEBRA_SKIP_IPV6_TESTS -e ZEBRA_TEST_LIGHTWALLETD --name zebrad-tests -t ${{ env.GAR_BASE }}/${{ env.IMAGE_NAME }}:sha-${{ env.GITHUB_SHA_SHORT }} cargo test --locked --release --features enable-sentry --test acceptance -- lightwalletd_integration --nocapture env: - ZEBRA_TEST_LIGHTWALLETD: "1" + ZEBRA_TEST_LIGHTWALLETD: '1' regenerate-stateful-disks: name: Regenerate stateful disks @@ -213,13 +214,13 @@ jobs: outputs: any_changed: ${{ steps.changed-files-specific.outputs.any_changed }} permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 with: persist-credentials: false - fetch-depth: "2" + fetch-depth: '2' # only run this job if the database format might have changed - name: Get specific changed files @@ -256,9 +257,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA @@ -359,8 +360,8 @@ jobs: runs-on: ubuntu-latest needs: [build, regenerate-stateful-disks] permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 @@ -376,9 +377,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' # Check if our destination compute instance exists and delete it - name: Delete existing instance with same SHA diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index fd3603c8600..dd71d17c606 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -4,21 +4,21 @@ on: workflow_dispatch: push: branches: - - "main" + - 'main' paths: # rebuild lightwalletd whenever the related Zebra code changes # # TODO: this code isn't compiled in this docker image # rebuild whenever the actual code at adityapk00/lightwalletd/master changes - - "zebra-rpc/**" - - "zebrad/tests/acceptance.rs" - - "zebrad/src/config.rs" - - "zebrad/src/commands/start.rs" + - 'zebra-rpc/**' + - 'zebrad/tests/acceptance.rs' + - 'zebrad/src/config.rs' + - 'zebrad/src/commands/start.rs' # workflow definitions # # unlike the Zebra code, these workflow definitions do change the docker image - - "docker/zcash-lightwalletd/Dockerfile" - - ".github/workflows/zcash-lightwalletd.yml" + - 'docker/zcash-lightwalletd/Dockerfile' + - '.github/workflows/zcash-lightwalletd.yml' env: PROJECT_ID: zealous-zebra @@ -31,14 +31,14 @@ jobs: name: Build images runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 with: repository: adityapk00/lightwalletd - ref: "master" + ref: 'master' persist-credentials: false - uses: actions/checkout@v3.0.0 @@ -86,9 +86,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 diff --git a/.github/workflows/zcash-params.yml b/.github/workflows/zcash-params.yml index f3d2fe2c70a..58649f56dee 100644 --- a/.github/workflows/zcash-params.yml +++ b/.github/workflows/zcash-params.yml @@ -4,18 +4,18 @@ on: workflow_dispatch: push: branches: - - "main" + - 'main' paths: # parameter download code - - "zebra-consensus/src/primitives/groth16/params.rs" - - "zebra-consensus/src/chain.rs" - - "zebrad/src/commands/start.rs" + - 'zebra-consensus/src/primitives/groth16/params.rs' + - 'zebra-consensus/src/chain.rs' + - 'zebrad/src/commands/start.rs' # workflow definitions - - "docker/zcash-params/Dockerfile" - - ".github/workflows/zcash-params.yml" + - 'docker/zcash-params/Dockerfile' + - '.github/workflows/zcash-params.yml' env: - CARGO_INCREMENTAL: "1" + CARGO_INCREMENTAL: '1' PROJECT_ID: zealous-zebra GAR_BASE: us-docker.pkg.dev/zealous-zebra/zebra GCR_BASE: gcr.io/zealous-zebra @@ -28,8 +28,8 @@ jobs: # timeout-minutes: 180 runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 @@ -76,9 +76,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' - name: Login to Google Artifact Registry uses: docker/login-action@v1.14.1 diff --git a/.github/workflows/zcashd-manual-deploy.yml b/.github/workflows/zcashd-manual-deploy.yml index 15537423f86..9b35102f3b8 100644 --- a/.github/workflows/zcashd-manual-deploy.yml +++ b/.github/workflows/zcashd-manual-deploy.yml @@ -4,12 +4,12 @@ on: workflow_dispatch: inputs: network: - default: "Mainnet" - description: "Network to deploy: Mainnet or Testnet" + default: 'Mainnet' + description: 'Network to deploy: Mainnet or Testnet' required: true size: - default: "10" - description: "GCP Managed Instance Group size" + default: '10' + description: 'GCP Managed Instance Group size' required: true env: @@ -24,8 +24,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: "read" - id-token: "write" + contents: 'read' + id-token: 'write' steps: - uses: actions/checkout@v3.0.0 @@ -42,9 +42,9 @@ jobs: id: auth uses: google-github-actions/auth@v0.6.0 with: - workload_identity_provider: "projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc" - service_account: "github-service-account@zealous-zebra.iam.gserviceaccount.com" - token_format: "access_token" + workload_identity_provider: 'projects/143793276228/locations/global/workloadIdentityPools/github-actions/providers/github-oidc' + service_account: 'github-service-account@zealous-zebra.iam.gserviceaccount.com' + token_format: 'access_token' # Create instance template from container image - name: Create instance template From 22961da4d9afe7d8942ddc5be727fe5884a8d543 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 23 Mar 2022 06:44:59 -0400 Subject: [PATCH 04/12] style: lint dependabot and mergify conf files --- .github/dependabot.yml | 40 ++++++++++++++++++++-------------------- .github/mergify.yml | 18 +++++++++--------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9a7c7986c74..dfc26fa4b39 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,22 +1,22 @@ version: 2 updates: -- package-ecosystem: cargo - directory: "/" - schedule: - interval: daily - timezone: America/New_York - open-pull-requests-limit: 10 - labels: - - "A-dependencies" - - "A-rust" - - "P-Low :snowflake:" -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - timezone: America/New_York - open-pull-requests-limit: 10 - labels: - - "A-infrastructure" - - "A-dependencies" - - "P-Low :snowflake:" + - package-ecosystem: cargo + directory: '/' + schedule: + interval: daily + timezone: America/New_York + open-pull-requests-limit: 10 + labels: + - 'A-dependencies' + - 'A-rust' + - 'P-Low :snowflake:' + - package-ecosystem: github-actions + directory: '/' + schedule: + interval: daily + timezone: America/New_York + open-pull-requests-limit: 10 + labels: + - 'A-infrastructure' + - 'A-dependencies' + - 'P-Low :snowflake:' diff --git a/.github/mergify.yml b/.github/mergify.yml index a71ed2bd182..0e93f64363a 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -51,13 +51,13 @@ queue_rules: pull_request_rules: - name: move to urgent queue when CI passes with 1 review and not WIP targeting main conditions: - - "#approved-reviews-by>=1" - - "#review-threads-unresolved=0" + - '#approved-reviews-by>=1' + - '#review-threads-unresolved=0' - -draft - base=main - or: - - "label~=^P-Critical" - - "label~=^P-High" + - 'label~=^P-Critical' + - 'label~=^P-High' - label!=do-not-merge actions: queue: @@ -66,11 +66,11 @@ pull_request_rules: - name: move to medium queue when CI passes with 1 review and not WIP targeting main conditions: - - "#approved-reviews-by>=1" - - "#review-threads-unresolved=0" + - '#approved-reviews-by>=1' + - '#review-threads-unresolved=0' - -draft - base=main - - "label~=^P-Medium" + - 'label~=^P-Medium' - label!=do-not-merge actions: queue: @@ -79,8 +79,8 @@ pull_request_rules: - name: move to low queue when CI passes with 1 review and not WIP targeting main conditions: - - "#approved-reviews-by>=1" - - "#review-threads-unresolved=0" + - '#approved-reviews-by>=1' + - '#review-threads-unresolved=0' - -draft - base=main - label!=do-not-merge From 7047f0ae7d268be5344a03713034dcfb721fdd83 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 23 Mar 2022 06:56:04 -0400 Subject: [PATCH 05/12] style: remove conditions with missing context --- .github/workflows/test.patch.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test.patch.yml b/.github/workflows/test.patch.yml index 22c82dfa53e..6b36f48d8d5 100644 --- a/.github/workflows/test.patch.yml +++ b/.github/workflows/test.patch.yml @@ -25,7 +25,6 @@ jobs: name: Test all runs-on: ubuntu-latest needs: build - if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -33,7 +32,6 @@ jobs: name: Test with fake activation heights runs-on: ubuntu-latest needs: build - if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -42,7 +40,6 @@ jobs: name: Test checkpoint sync from empty state runs-on: ubuntu-latest needs: build - if: github.event.inputs.regenerate-disks != 'true' steps: - run: 'echo "No build required"' @@ -50,8 +47,6 @@ jobs: name: Regenerate stateful disks runs-on: ubuntu-latest needs: build - outputs: - disk_short_sha: ${{ steps.disk-short-sha.outputs.disk_short_sha }} steps: - run: 'echo "No build required"' From bc8444e46f9dd693557899d0073b256c73e288f2 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 30 Mar 2022 07:12:46 -0400 Subject: [PATCH 06/12] imp(lint): automate GH Actions linting --- .github/workflows/lint.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7da443026b2..57905f9b2b3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -82,3 +82,9 @@ jobs: with: command: fmt args: --all -- --check + + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: reviewdog/action-actionlint@v1.21.0 From dd011eb0e19c7ddd48f774b5c9eecdacfa875479 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 30 Mar 2022 07:20:18 -0400 Subject: [PATCH 07/12] fix(lint): some actions need to be triggered by PR event --- .github/workflows/lint.patch.yml | 5 ++--- .github/workflows/lint.yml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.patch.yml b/.github/workflows/lint.patch.yml index cb37a5e3857..379f8a05a18 100644 --- a/.github/workflows/lint.patch.yml +++ b/.github/workflows/lint.patch.yml @@ -1,10 +1,9 @@ name: Lint Rust files on: - push: + pull_request: branches: - - '**' - - '!main' + - 'main' paths-ignore: - '**/*.rs' - '**/Cargo.toml' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 57905f9b2b3..edc546a5c64 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,10 +1,9 @@ name: Lint Rust files on: - push: + pull_request: branches: - - '**' - - '!main' + - 'main' paths: # code and tests - '**/*.rs' From 22543b71c8e42763d0ffd24022b3f0c6afa9ff11 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 3 Apr 2022 21:37:31 -0400 Subject: [PATCH 08/12] fix(lint): consider all workflow YAMLs --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index edc546a5c64..854d748aa6a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ on: # workflow definitions - 'clippy.toml' - '.cargo/config.toml' - - '.github/workflows/lint.yml' + - '.github/workflows/*.yml' env: CARGO_INCREMENTAL: 0 From 1fa586b8e52a01611e95f47d66ebd673d73b781b Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 3 Apr 2022 21:38:15 -0400 Subject: [PATCH 09/12] Use the same paths in the patch file --- .github/workflows/lint.patch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.patch.yml b/.github/workflows/lint.patch.yml index 379f8a05a18..4d06d6bb789 100644 --- a/.github/workflows/lint.patch.yml +++ b/.github/workflows/lint.patch.yml @@ -10,7 +10,7 @@ on: - '**/Cargo.lock' - 'clippy.toml' - '.cargo/config.toml' - - '.github/workflows/lint.yml' + - '.github/workflows/*.yml' jobs: clippy: From 9003ecc064d98df9ec32cbb9ae06f94695f3d3ec Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 3 Apr 2022 21:47:49 -0400 Subject: [PATCH 10/12] revert: keep condition as is --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9fd401f160c..b00e2e7d17e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -132,7 +132,7 @@ jobs: permissions: contents: 'read' id-token: 'write' - if: github.event_name == 'push' && github.ref_name == 'main' + if: ${{ github.event_name == 'push' && github.ref_name == 'main' }} steps: - name: Inject slug/short variables From 0f5a20094935a5032cfe5f6addc65561cf3225c7 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 3 Apr 2022 21:54:35 -0400 Subject: [PATCH 11/12] add TODO --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 854d748aa6a..18d41b3bebc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,6 +13,7 @@ on: # workflow definitions - 'clippy.toml' - '.cargo/config.toml' + # TODO: we might want to run this in a separate workflow in the future for the `actionlint` job - '.github/workflows/*.yml' env: From 234945fc27ae8e7306bf0cb8f37b708d400ff2f4 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Tue, 5 Apr 2022 19:15:09 -0400 Subject: [PATCH 12/12] fix: add missing checkpoint_sync input --- .github/workflows/test-full-sync.yml | 4 ++++ .github/workflows/test.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/test-full-sync.yml b/.github/workflows/test-full-sync.yml index a1f3047b4e9..4905b9c04e6 100644 --- a/.github/workflows/test-full-sync.yml +++ b/.github/workflows/test-full-sync.yml @@ -7,6 +7,10 @@ on: default: 'Mainnet' description: 'Network to deploy: Mainnet or Testnet' required: true + checkpoint_sync: + default: 'true' + description: 'Configures `zebrad` to use as many checkpoints as possible' + required: true pull_request: branches: - main diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c3edffd497..2c28b1cdb35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,10 @@ on: default: 'Mainnet' description: 'Network to deploy: Mainnet or Testnet' required: true + checkpoint_sync: + default: 'true' + description: 'Configures `zebrad` to use as many checkpoints as possible' + required: true regenerate-disks: type: boolean default: false