Skip to content

Commit

Permalink
Merge pull request #169 from zeapoz/zcash-ci
Browse files Browse the repository at this point in the history
Improve zcash ci
  • Loading branch information
aphelionz committed Oct 10, 2022
2 parents 198d8e9 + 706faf4 commit cd5f11c
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 22 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/zcashd-nightly.yml
@@ -0,0 +1,95 @@
name: zcashd-nightly

on:
workflow_dispatch:
push:
branches: [ "main" ]

jobs:
install-zcashd:
runs-on: ubuntu-latest
steps:
- name: clone zcashd
run: git clone https://github.com/zcash/zcash
- name: build zcashd
run: |
cd zcash
./zcutil/build.sh -j$(nproc)
- uses: actions/upload-artifact@v2
with:
name: zcashd-fetch-params
path: ./zcash/zcutil/fetch-params.sh
- uses: actions/upload-artifact@v2
with:
name: zcashd-executable
path: ./zcash/src/zcashd

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets --no-run
- uses: actions/upload-artifact@v2
with:
name: ziggurat-executable
path: ./target/debug/deps/ziggurat-*

test-zcashd:
runs-on: ubuntu-latest
needs: [ check, install-zcashd ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: zcashd-fetch-params
path: ./zcash
- uses: actions/download-artifact@v3
with:
name: zcashd-executable
path: ./zcash
- uses: actions/download-artifact@v3
with:
name: ziggurat-executable
path: ./ziggurat
- name: Create ~/.ziggurat/config.toml
run: |
mkdir ~/.ziggurat/
touch ~/.ziggurat/config.toml
echo kind = \"zcashd\" >> ~/.ziggurat/config.toml
echo path = \"/home/runner/work/ziggurat/ziggurat/zcash\" >> ~/.ziggurat/config.toml
echo start_command = \"./zcashd -debug=1 -printtoconsole -logips=1 -dnsseed=0 -dns=0 -listenonion=0\" >> ~/.ziggurat/config.toml
- name: Fetch zcashd params
run: |
chmod +x zcash/fetch-params.sh
./zcash/fetch-params.sh
- name: Run ziggurat suite
continue-on-error: true
env:
FILENAME: ${{ github.event.repository.updated_at }}
run: |
rm ./ziggurat/*.d
mv ./ziggurat/ziggurat-* ziggurat_test
chmod +x ziggurat_test
chmod +x zcash/zcashd
mkdir -p results
./ziggurat_test --test-threads=1 --nocapture -Z unstable-options --report-time --format json > results/$FILENAME.jsonl
rm -r results/latest.jsonl
cp results/$FILENAME.jsonl results/latest.jsonl
- name: git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add results
git commit -m "ci: zcashd suite results"
git push
38 changes: 24 additions & 14 deletions .github/workflows/zcashd.yml
Expand Up @@ -3,24 +3,22 @@ name: zcashd
on:
workflow_dispatch:
push:
branches: [ "zcash-ci" ]
# pull_request:
# branches: [ main ]
branches: [ "main" ]

jobs:
install-zcashd:
runs-on: ubuntu-latest
steps:
- name: clone zcashd
run: git clone https://github.com/zcash/zcash
- name: fetch params
run: |
cd zcash
./zcutil/fetch-params.sh
- name: build zcashd
run: |
cd zcash
./zcutil/build.sh -j$(nproc)
- uses: actions/upload-artifact@v2
with:
name: zcashd-fetch-params
path: ./zcash/zcutil/fetch-params.sh
- uses: actions/upload-artifact@v2
with:
name: zcashd-executable
Expand Down Expand Up @@ -49,25 +47,37 @@ jobs:
runs-on: ubuntu-latest
needs: [ check, install-zcashd ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: zcashd-fetch-params
path: ./zcash
- uses: actions/download-artifact@v3
with:
name: zcashd-executable
path: ./zcashd
path: ./zcash
- uses: actions/download-artifact@v3
with:
name: ziggurat-executable
path: ./ziggurat
- name: Create ~/.ziggurat/config.toml
run: |
git clone https://github.com/zcash/zcash
mkdir ~/.ziggurat/
touch ~/.ziggurat/config.toml
echo kind = \"zcashd\" >> ~/.ziggurat/config.toml
echo path = \"./zcash\" >> ~/.ziggurat/config.toml
echo start_command = \"../zcashd -debug=1 -printtoconsole -logips=1 -dnsseed=0 -dns=0 -listenonion=0\" >> ~/.ziggurat/config.toml
- run: |
echo path = \"/home/runner/work/ziggurat/ziggurat/zcash\" >> ~/.ziggurat/config.toml
echo start_command = \"./zcashd -debug=1 -printtoconsole -logips=1 -dnsseed=0 -dns=0 -listenonion=0\" >> ~/.ziggurat/config.toml
- name: Fetch zcashd params
run: |
chmod +x zcash/fetch-params.sh
./zcash/fetch-params.sh
- name: Run ziggurat suite
continue-on-error: true
run: |
rm ./ziggurat/*.d
mv ./ziggurat/ziggurat-* ziggurat_test
chmod +x ziggurat_test
chmod +x zcashd
./ziggurat_test --test-threads=1
chmod +x zcash/zcashd
./ziggurat_test --test-threads=1 --nocapture
10 changes: 4 additions & 6 deletions .github/workflows/zebra.yml
Expand Up @@ -3,9 +3,7 @@ name: Zebra
on:
workflow_dispatch:
push:
branches: [ "zcash-ci" ]
# pull_request:
# branches: [ main ]
branches: [ "main" ]

jobs:
build-zebra:
Expand Down Expand Up @@ -33,7 +31,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -65,7 +63,7 @@ jobs:
mkdir ~/.ziggurat/
touch ~/.ziggurat/config.toml
echo kind = \"zebra\" >> ~/.ziggurat/config.toml
echo path = \"./zebra\" >> ~/.ziggurat/config.toml
echo path = \"zebra\" >> ~/.ziggurat/config.toml
echo start_command = \"../zebrad/zebrad start\" >> ~/.ziggurat/config.toml
- name: Download Zebra params
run: |
Expand All @@ -74,4 +72,4 @@ jobs:
rm ./ziggurat/*.d
mv ./ziggurat/ziggurat-* ziggurat_test
chmod +x ziggurat_test
./ziggurat_test --test-threads=1
./ziggurat_test --test-threads=1 -Z unstable-options --format json
4 changes: 2 additions & 2 deletions src/tools/mod.rs
Expand Up @@ -9,9 +9,9 @@ use std::time::Duration;

/// Default timeout for connection operations in seconds.
/// TODO: move to config file.
pub const LONG_TIMEOUT: Duration = Duration::from_secs(10);
pub const LONG_TIMEOUT: Duration = Duration::from_secs(30);
/// Default timeout for response-specific reads in seconds.
pub const RECV_TIMEOUT: Duration = Duration::from_millis(100);
pub const RECV_TIMEOUT: Duration = Duration::from_millis(300);

/// Waits until an expression is true or times out.
///
Expand Down

0 comments on commit cd5f11c

Please sign in to comment.