Skip to content

Run canonical test cases for the Rust generator #174

Run canonical test cases for the Rust generator

Run canonical test cases for the Rust generator #174

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
FORCE_COLOR: 3
RUSTFLAGS: -D warnings
jobs:
build:
name: Build
strategy:
matrix:
rust:
- 1.68.0 # This is the Rust version used in Android.
- stable
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install ${{ matrix.rust }} Rust
run: rustup default ${{ matrix.rust }}
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install rustfmt
run: rustup component add rustfmt
- name: Rust tests
run: cargo test
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Build documentation
env:
RUSTDOCFLAGS: --deny rustdoc::broken_intra_doc_links
run: cargo doc --no-deps
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --no-deps
test:
name: Canonical Tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install stable Rust
run: rustup default stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install dependencies
run: |
sudo apt install libgtest-dev
python3 -m pip install typing_extensions
- name: Install pdlc
run: cargo install --path pdl-compiler/
- name: Run Rust generator tests
run: pdl-compiler/tests/run_rust_generator_tests.sh
- name: Run CXX generator tests
run: pdl-compiler/tests/run_cxx_generator_tests.sh
- name: Run Python generator tests
run: pdl-compiler/tests/run_python_generator_tests.sh