Skip to content

chore: fix docs building #4

chore: fix docs building

chore: fix docs building #4

Workflow file for this run

name: Pull Request
on:
pull_request:
branches:
- "main"
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: "--cfg=ci_run"
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
UV_VERSION: "0.4.29"
UV_FROZEN: 1
UV_EXTRA_INDEX_URL: "https://github_actions:${{secrets.PRIVATE_PYPI_PASS}}@cqcpythonrepository.azurewebsites.net/simple/"
jobs:
check-rust:
name: Check Rust
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
run-type: ["lint", "test"]
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
if: ${{ matrix.run-type == 'test' }}
- name: Setup dependencies.
run: uv sync --python ${{ matrix.python-version }}
if: ${{ matrix.run-type == 'test' }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# if: ${{ matrix.run-type == 'test' }}
- name: "Run tests"
run: |
(cd tierkreis-server && cargo build)
uv run cargo test --verbose
if: ${{ matrix.run-type == 'test' }}
- name: "Check code with rustfmt"
run: cargo fmt -- --check
if: ${{ matrix.run-type == 'lint' }}
- name: "Lint code with clippy"
run: |
cargo clippy -- -D warnings
if: ${{ matrix.run-type == 'lint' }}
- name: "Generate crate docs"
run: cargo doc --no-deps --all-features --workspace
env:
RUSTDOCFLAGS: "-Dwarnings"
if: ${{ matrix.run-type == 'lint' }}
- uses: actions/upload-artifact@v4
with:
name: tierkreis-server
path: target/debug/tierkreis-server
if: ${{ matrix.run-type == 'test' }}
check-python:
name: Check tierkreis python
runs-on: ubuntu-latest
needs: check-rust
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: ${{ env.UV_VERSION }}
enable-cache: true
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Setup dependencies.
run: uv sync --python ${{ matrix.python-version }}
- name: Check formatting with ruff
run: uv run ruff format --check
- name: Lint with ruff
run: uv run ruff check
- name: Check static typing with pyright
run: |
(cd python && uv run pyright)
(cd integration && uv run pyright)
- uses: actions/download-artifact@v4
with:
name: tierkreis-server
path: target/debug
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Test with pytest
env:
SERVER: target/debug/tierkreis-server
CONFIG_FILE: .github/workflows/pr_server_config.json
RUN_SCRIPT: .github/workflows/run_with_server
run: |
uv run pytest python
chmod +x $SERVER $RUN_SCRIPT
# run pytest with local server
uv run $RUN_SCRIPT $SERVER $CONFIG_FILE pytest python --host=localhost --port=8090 --client-only
- run: uv run pytest integration