Skip to content

Minor codegen cleanups (#162) #330

Minor codegen cleanups (#162)

Minor codegen cleanups (#162) #330

Workflow file for this run

name: CI
env:
PROTOBUF_VER: 3.17.3
# Run on git push, PR, or manually from the Actions tab
on: [push, pull_request, workflow_dispatch]
jobs:
rustfmt:
name: Check formatting with rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- run: rustup component add rustfmt --toolchain nightly
- name: Run rustfmt
run: rustup run nightly ci/run_rustfmt.sh
black:
name: Run black formatter on codegen.py
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
- uses: actions/checkout@v2
- run: ci/run_black.sh
mypy:
name: Run mypy on codegen.py
runs-on: ubuntu-latest
steps:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v2
- uses: actions/checkout@v2
- run: ci/run_mypy.sh
pb-jelly-unit:
name: pb-jelly unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Run unit tests
run: |
cd pb-jelly
rustup run nightly cargo test
pb-jelly-gen-unit:
name: pb-jelly-gen unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup update nightly
- name: Run unit tests
run: |
cd pb-jelly-gen
rustup run nightly cargo test
pbtest:
strategy:
matrix:
plat: [ubuntu-latest, macos-latest, windows-latest]
name: pbtest integration test (${{matrix.plat}})
runs-on: ${{matrix.plat}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run integration test
env:
VALIDATE: 1
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo test
examples:
name: examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
cd examples/examples_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo test
benchmarks:
name: benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: rustup update nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run benchmark
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run --features=bench_prost,bench_rust_protobuf
cd ..
rustup run nightly cargo bench bench --features=bench_prost,bench_rust_protobuf
clippy_gen:
name: clippy gen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: rustup update nightly
- run: rustup component add clippy --toolchain nightly
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: ${{env.PROTOBUF_VER}}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run clippy
env:
RUSTFLAGS: "-D warnings"
run: |
cd pb-test/pb_test_gen
rustup run nightly cargo run
cd ..
rustup run nightly cargo clippy -p proto_pbtest