Skip to content

Zeitgeist Client Update Automation #3665

Zeitgeist Client Update Automation

Zeitgeist Client Update Automation #3665

Workflow file for this run

name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
- uses: actions-rs/[email protected]
with:
crate: taplo-cli
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Format
run: ./scripts/tests/format.sh --check
copyright:
name: Copyright Notices
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: Install check-license and dependencies
run: |
pip install scripts/check-license
pip install -r scripts/check-license/requirements.txt
- name: Query files changed
id: files_changed
uses: Ana06/[email protected]
with:
filter: '*.rs$'
- name: Check copyright notices
run: check-license ${{ steps.files_changed.outputs.added_modified }}
checks:
name: Checks
runs-on: ubuntu-latest
strategy:
matrix:
scripts: [
"clippy",
"parachain",
"standalone"
]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Checks
run: ./scripts/tests/${{ matrix.scripts }}.sh
benchmark:
name: Quick check benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
- run: ./scripts/benchmarks/quick_check.sh
test_standalone:
name: Test standalone build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
# No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006
# Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up disk space on GitHub hosted runners
run: |
# Ensure context is GitHub hosted runner
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then
echo "Freeing up space in GitHub hosted runner"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Tests
run: ./scripts/tests/test_standalone.sh
test_parachain:
name: Test parachain build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
# No disk space: https://github.com/zeitgeistpm/zeitgeist/actions/runs/5085081984/jobs/9144298675?pr=1006
# Workaround: https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up disk space on GitHub hosted runners
run: |
# Ensure context is GitHub hosted runner
# https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
if [[ "${{ runner.name }}" == "GitHub Actions"* ]]; then
echo "Freeing up space in GitHub hosted runner"
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- name: Tests
run: ./scripts/tests/test_parachain.sh
fuzz:
name: Fuzz
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install build tools
run: ./scripts/init.sh
- uses: actions-rs/[email protected]
with:
crate: cargo-fuzz
use-tool-cache: true
- name: Cache Dependencies
uses: Swatinem/rust-cache@v1
- run: ./scripts/tests/fuzz.sh --verbose