Use systemd watchdog to restart a node #7658
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ZQ2 CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
merge_group: | |
types: | |
- checks_requested | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
env: | |
CARGO_TERM_COLOR: always | |
# Run a decent number of samples for our randomized tests | |
ZQ_TEST_SAMPLES: 20 | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "16" | |
- run: npm install --save-dev prettier prettier-plugin-solidity solhint | |
- run: npx prettier --write --plugin=prettier-plugin-solidity './**/*.sol' | |
- run: npx solhint 'zilliqa/src/contracts/**/*.sol' --fix --noPrompt | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Apply formatting changes to solidity files | |
branch: ${{ github.head_ref }} | |
add_options: "-u" | |
file_pattern: "*.sol" | |
status_options: "--untracked-files=no" | |
check: | |
runs-on: [self-hosted, gcp] | |
steps: | |
- name: Install Rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: Install nightly | |
run: rustup toolchain install nightly | |
- name: Install dependencies | |
run: sudo add-apt-repository ppa:ethereum/ethereum && sudo apt update && sudo apt install -y solc build-essential pkg-config libssl-dev cmake protobuf-compiler libsystemd-dev | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --all-targets --all-features | |
- name: Clippy | |
run: cargo clippy --all --all-targets --all-features -- -D warnings | |
# Run `cargo fmt` with nightly, because we use 'unstable' rustfmt features. | |
- name: rustfmt | |
run: cargo +nightly fmt --all --check | |
- name: Test | |
run: cargo test --tests --examples --bins --all-features | |
- name: Verify working directory is clean | |
run: git diff --exit-code | |
e2e_test: | |
services: | |
scilla: | |
image: asia-docker.pkg.dev/prj-p-devops-services-tvwmrf63/zilliqa-public/scilla:a5a81f72 | |
options: --init --add-host host.docker.internal:host-gateway --entrypoint "/scilla/0/bin/scilla-server-http" | |
ports: | |
- 3000:3000 | |
volumes: | |
- /tmp:/scilla_ext_libs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Test connection to Scilla server | |
run: curl http://localhost:3000 | |
- name: Install Rust | |
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- uses: Swatinem/rust-cache@v2 | |
- name: JS test framework | |
run: export PATH="/scilla/0/bin:$PATH" && ./scripts/js_test.sh |