Skip to content

mono repo final sync #77

mono repo final sync

mono repo final sync #77

Workflow file for this run

name: Main-CI-Flow
on:
push:
branches:
- main
- main-v[0-9].**
tags:
- v[0-9].**
pull_request:
types:
- opened
- reopened
- synchronize
- auto_merge_enabled
- edited
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install commitlint
run: npm install --global @commitlint/cli @commitlint/config-conventional
- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request' && !(contains(github.event.pull_request.title, '/merge-main') || contains(github.event.pull_request.title, '/merge main'))
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: commitlint --from "$BASE_SHA" --to "$HEAD_SHA" --verbose
- name: Validate PR title with commitlint
if: github.event_name != 'merge_group' && github.event_name != 'push' && !(contains(github.event.pull_request.title, '/merge-main') || contains(github.event.pull_request.title, '/merge main'))
env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "$TITLE" | commitlint --verbose
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: rustfmt
toolchain: nightly-2024-04-29
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
- run: scripts/rust_fmt.sh --check
clippy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: Noelware/setup-protoc@1.1.0
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
id: setup-pypy
with:
python-version: 'pypy3.9'
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ steps.setup-pypy.outputs.pythonLocation }}/bin
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- run: scripts/clippy.sh
run-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Noelware/setup-protoc@1.1.0
- uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust-ubuntu-20.04"
# Setup pypy and link to the location expected by .cargo/config.toml.
- uses: actions/setup-python@v5
id: setup-pypy
with:
python-version: 'pypy3.9'
- run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
- env:
LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
- name: "Run tests"
run: |
python3 -m venv ci
ci/bin/pip install -r scripts/requirements.txt
ci/bin/python scripts/run_tests.py --changes_only --commit_id ${{ github.event.pull_request.base.sha }}
ci/bin/python scripts/run_tests.py --changes_only --features concurrency --commit_id ${{ github.event.pull_request.base.sha }}
env:
SEED: 0
# Keep the name 'udeps' to match original action name, so we don't need to define specific branch
# rules on Github for specific version branches.
machete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Machete (detect unused dependencies)
uses: bnjbvr/cargo-machete@main
udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
name: "Rust Toolchain Setup"
with:
toolchain: nightly-2024-01-12
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
version: ${{env.PROTOC_VERSION}}
- name: "Download and run cargo-udeps"
run: |
wget -O - -c https://github.com/est31/cargo-udeps/releases/download/v0.1.35/cargo-udeps-v0.1.35-x86_64-unknown-linux-gnu.tar.gz | tar -xz
cargo-udeps-*/cargo-udeps udeps
env:
RUSTUP_TOOLCHAIN: nightly-2024-01-12
check:
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: Noelware/setup-protoc@1.1.0
with:
version: ${{env.PROTOC_VERSION}}
- run: cargo check --workspace -r --all-features