style(ci): lint and standardize the actions structure (#3940)
* style(ci): comply with https://json.schemastore.org/github-workflow.json Some substituions were harder to make as files were not standardized * fix(mergify): use correct name for macos * style(actions): revert to single quotes * style: lint dependabot and mergify conf files * style: remove conditions with missing context * imp(lint): automate GH Actions linting * fix(lint): some actions need to be triggered by PR event * fix(lint): consider all workflow YAMLs * Use the same paths in the patch file * revert: keep condition as is * add TODO * fix: add missing checkpoint_sync input Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
d09769714f
commit
831a2009bd
|
|
@ -1,22 +1,22 @@
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: cargo
|
- package-ecosystem: cargo
|
||||||
directory: "/"
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
timezone: America/New_York
|
timezone: America/New_York
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
labels:
|
labels:
|
||||||
- "A-dependencies"
|
- 'A-dependencies'
|
||||||
- "A-rust"
|
- 'A-rust'
|
||||||
- "P-Low :snowflake:"
|
- 'P-Low :snowflake:'
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
directory: "/"
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
timezone: America/New_York
|
timezone: America/New_York
|
||||||
open-pull-requests-limit: 10
|
open-pull-requests-limit: 10
|
||||||
labels:
|
labels:
|
||||||
- "A-infrastructure"
|
- 'A-infrastructure'
|
||||||
- "A-dependencies"
|
- 'A-dependencies'
|
||||||
- "P-Low :snowflake:"
|
- 'P-Low :snowflake:'
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ queue_rules:
|
||||||
- check-success=Test full validation sync from cached state
|
- 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 zebra-state with fake activation heights on ubuntu-latest
|
||||||
- check-success=Test stable 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
|
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
|
||||||
# - check-success=Test stable on windows-latest
|
# - check-success=Test stable on windows-latest
|
||||||
- check-success=Clippy
|
- check-success=Clippy
|
||||||
|
|
@ -27,7 +27,7 @@ queue_rules:
|
||||||
- check-success=Test full validation sync from cached state
|
- 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 zebra-state with fake activation heights on ubuntu-latest
|
||||||
- check-success=Test stable 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=Test stable on windows-latest
|
||||||
- check-success=Clippy
|
- check-success=Clippy
|
||||||
- check-success=Rustfmt
|
- check-success=Rustfmt
|
||||||
|
|
@ -43,7 +43,7 @@ queue_rules:
|
||||||
- check-success=Test full validation sync from cached state
|
- 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 zebra-state with fake activation heights on ubuntu-latest
|
||||||
- check-success=Test stable 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=Test stable on windows-latest
|
||||||
- check-success=Clippy
|
- check-success=Clippy
|
||||||
- check-success=Rustfmt
|
- check-success=Rustfmt
|
||||||
|
|
@ -51,13 +51,13 @@ queue_rules:
|
||||||
pull_request_rules:
|
pull_request_rules:
|
||||||
- name: move to urgent queue when CI passes with 1 review and not WIP targeting main
|
- name: move to urgent queue when CI passes with 1 review and not WIP targeting main
|
||||||
conditions:
|
conditions:
|
||||||
- "#approved-reviews-by>=1"
|
- '#approved-reviews-by>=1'
|
||||||
- "#review-threads-unresolved=0"
|
- '#review-threads-unresolved=0'
|
||||||
- -draft
|
- -draft
|
||||||
- base=main
|
- base=main
|
||||||
- or:
|
- or:
|
||||||
- "label~=^P-Critical"
|
- 'label~=^P-Critical'
|
||||||
- "label~=^P-High"
|
- 'label~=^P-High'
|
||||||
- label!=do-not-merge
|
- label!=do-not-merge
|
||||||
actions:
|
actions:
|
||||||
queue:
|
queue:
|
||||||
|
|
@ -66,11 +66,11 @@ pull_request_rules:
|
||||||
|
|
||||||
- name: move to medium queue when CI passes with 1 review and not WIP targeting main
|
- name: move to medium queue when CI passes with 1 review and not WIP targeting main
|
||||||
conditions:
|
conditions:
|
||||||
- "#approved-reviews-by>=1"
|
- '#approved-reviews-by>=1'
|
||||||
- "#review-threads-unresolved=0"
|
- '#review-threads-unresolved=0'
|
||||||
- -draft
|
- -draft
|
||||||
- base=main
|
- base=main
|
||||||
- "label~=^P-Medium"
|
- 'label~=^P-Medium'
|
||||||
- label!=do-not-merge
|
- label!=do-not-merge
|
||||||
actions:
|
actions:
|
||||||
queue:
|
queue:
|
||||||
|
|
@ -79,8 +79,8 @@ pull_request_rules:
|
||||||
|
|
||||||
- name: move to low queue when CI passes with 1 review and not WIP targeting main
|
- name: move to low queue when CI passes with 1 review and not WIP targeting main
|
||||||
conditions:
|
conditions:
|
||||||
- "#approved-reviews-by>=1"
|
- '#approved-reviews-by>=1'
|
||||||
- "#review-threads-unresolved=0"
|
- '#review-threads-unresolved=0'
|
||||||
- -draft
|
- -draft
|
||||||
- base=main
|
- base=main
|
||||||
- label!=do-not-merge
|
- label!=do-not-merge
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,12 @@ on:
|
||||||
inputs:
|
inputs:
|
||||||
network:
|
network:
|
||||||
default: 'Mainnet'
|
default: 'Mainnet'
|
||||||
|
description: 'Network to deploy: Mainnet or Testnet'
|
||||||
|
required: true
|
||||||
checkpoint_sync:
|
checkpoint_sync:
|
||||||
default: true
|
default: 'true'
|
||||||
|
description: 'Use as many checkpoints as possible when syncing'
|
||||||
|
required: true
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
|
# 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]
|
rust: [stable]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
|
# 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]
|
rust: [stable]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -67,7 +67,7 @@ jobs:
|
||||||
# Ubuntu runners don't have reliable network or DNS during test steps.
|
# Ubuntu runners don't have reliable network or DNS during test steps.
|
||||||
# Windows runners have an unreliable network.
|
# Windows runners have an unreliable network.
|
||||||
shell: bash
|
shell: bash
|
||||||
if: matrix.os != 'macOS-latest'
|
if: matrix.os != 'macos-latest'
|
||||||
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
|
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Minimise proptest cases on macOS and Windows
|
- name: Minimise proptest cases on macOS and Windows
|
||||||
|
|
@ -118,7 +118,7 @@ jobs:
|
||||||
|
|
||||||
- name: Run zebrad large sync tests
|
- 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
|
# 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
|
uses: actions-rs/cargo@v1.0.3
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
|
@ -159,7 +159,7 @@ jobs:
|
||||||
- name: Run tests with fake activation heights
|
- name: Run tests with fake activation heights
|
||||||
uses: actions-rs/cargo@v1.0.3
|
uses: actions-rs/cargo@v1.0.3
|
||||||
env:
|
env:
|
||||||
TEST_FAKE_ACTIVATION_HEIGHTS: ""
|
TEST_FAKE_ACTIVATION_HEIGHTS: ''
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
# Note: this only runs the zebra-state crate tests,
|
# Note: this only runs the zebra-state crate tests,
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ jobs:
|
||||||
# Exclude zebra-utils, it is not for library or app users
|
# Exclude zebra-utils, it is not for library or app users
|
||||||
cargo doc --no-deps --workspace --exclude zebra-utils
|
cargo doc --no-deps --workspace --exclude zebra-utils
|
||||||
env:
|
env:
|
||||||
RUSTDOCFLAGS: "--html-in-header katex-header.html"
|
RUSTDOCFLAGS: '--html-in-header katex-header.html'
|
||||||
|
|
||||||
- name: Deploy external docs to firebase
|
- name: Deploy external docs to firebase
|
||||||
uses: w9jds/firebase-action@v2.0.0
|
uses: w9jds/firebase-action@v2.0.0
|
||||||
|
|
@ -73,7 +73,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo doc --no-deps --document-private-items
|
cargo doc --no-deps --document-private-items
|
||||||
env:
|
env:
|
||||||
RUSTDOCFLAGS: "--html-in-header katex-header.html"
|
RUSTDOCFLAGS: '--html-in-header katex-header.html'
|
||||||
|
|
||||||
- name: Deploy internal docs to firebase
|
- name: Deploy internal docs to firebase
|
||||||
uses: w9jds/firebase-action@v2.0.0
|
uses: w9jds/firebase-action@v2.0.0
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
name: Lint Rust files
|
name: Lint Rust files
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- 'main'
|
||||||
- "!main"
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**/*.rs'
|
- '**/*.rs'
|
||||||
- '**/Cargo.toml'
|
- '**/Cargo.toml'
|
||||||
- '**/Cargo.lock'
|
- '**/Cargo.lock'
|
||||||
- 'clippy.toml'
|
- 'clippy.toml'
|
||||||
- '.cargo/config.toml'
|
- '.cargo/config.toml'
|
||||||
- '.github/workflows/lint.yml'
|
- '.github/workflows/*.yml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
clippy:
|
clippy:
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
name: Lint Rust files
|
name: Lint Rust files
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- 'main'
|
||||||
- "!main"
|
|
||||||
paths:
|
paths:
|
||||||
# code and tests
|
# code and tests
|
||||||
- '**/*.rs'
|
- '**/*.rs'
|
||||||
|
|
@ -14,7 +13,8 @@ on:
|
||||||
# workflow definitions
|
# workflow definitions
|
||||||
- 'clippy.toml'
|
- 'clippy.toml'
|
||||||
- '.cargo/config.toml'
|
- '.cargo/config.toml'
|
||||||
- '.github/workflows/lint.yml'
|
# TODO: we might want to run this in a separate workflow in the future for the `actionlint` job
|
||||||
|
- '.github/workflows/*.yml'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
|
|
@ -82,3 +82,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
command: fmt
|
command: fmt
|
||||||
args: --all -- --check
|
args: --all -- --check
|
||||||
|
|
||||||
|
actionlint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: reviewdog/action-actionlint@v1.21.0
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,12 @@ on:
|
||||||
inputs:
|
inputs:
|
||||||
network:
|
network:
|
||||||
default: 'Mainnet'
|
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:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
@ -24,7 +30,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: '1'
|
CARGO_INCREMENTAL: '1'
|
||||||
ZEBRA_SKIP_IPV6_TESTS: "1"
|
ZEBRA_SKIP_IPV6_TESTS: '1'
|
||||||
RUST_BACKTRACE: full
|
RUST_BACKTRACE: full
|
||||||
RUST_LIB_BACKTRACE: full
|
RUST_LIB_BACKTRACE: full
|
||||||
COLORBT_SHOW_HIDDEN: '1'
|
COLORBT_SHOW_HIDDEN: '1'
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@ jobs:
|
||||||
name: Test all
|
name: Test all
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo "No build required"'
|
- run: 'echo "No build required"'
|
||||||
|
|
||||||
|
|
@ -33,7 +32,6 @@ jobs:
|
||||||
name: Test with fake activation heights
|
name: Test with fake activation heights
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo "No build required"'
|
- run: 'echo "No build required"'
|
||||||
|
|
||||||
|
|
@ -42,7 +40,6 @@ jobs:
|
||||||
name: Test checkpoint sync from empty state
|
name: Test checkpoint sync from empty state
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo "No build required"'
|
- run: 'echo "No build required"'
|
||||||
|
|
||||||
|
|
@ -57,8 +54,6 @@ jobs:
|
||||||
name: Regenerate stateful disks
|
name: Regenerate stateful disks
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
outputs:
|
|
||||||
disk_short_sha: ${{ steps.disk-short-sha.outputs.disk_short_sha }}
|
|
||||||
steps:
|
steps:
|
||||||
- run: 'echo "No build required"'
|
- run: 'echo "No build required"'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,17 @@ on:
|
||||||
inputs:
|
inputs:
|
||||||
network:
|
network:
|
||||||
default: 'Mainnet'
|
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:
|
regenerate-disks:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
description: Just update stateful disks
|
description: 'Just update stateful disks'
|
||||||
|
required: true
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,13 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
network:
|
network:
|
||||||
default: 'Testnet'
|
default: 'Mainnet'
|
||||||
|
description: 'Network to deploy: Mainnet or Testnet'
|
||||||
|
required: true
|
||||||
size:
|
size:
|
||||||
default: 10
|
default: '10'
|
||||||
|
description: 'GCP Managed Instance Group size'
|
||||||
|
required: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PROJECT_ID: zealous-zebra
|
PROJECT_ID: zealous-zebra
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue