Skip to content

Bump runtime

Bump runtime #770

Workflow file for this run

name: dapr-rust-sdk
on:
schedule:
- cron: '8 8 * * *'
push:
branches:
- main
- release-*
tags:
- v*
pull_request:
branches:
- main
- release-*
env:
CARGO_TERM_COLOR: always
CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
PROTOC_VERSION: 24.4
RUSTFLAGS: "-D warnings"
jobs:
lint:
name: Check and Lint
runs-on: ubuntu-latest
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.PROTOC_VERSION }}
- uses: actions/checkout@v4
- name: Check compiled protos for a diff
run: |
make proto-gen check-diff-proto
- name: cargo fmt
run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }}
- name: cargo clippy
run: cargo clippy
build:
name: Test and Build on rust-${{ matrix.rust-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-version:
- "stable"
- "nightly"
- "1.78.0" # MSRV
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.PROTOC_VERSION }}
- uses: actions/checkout@v4
- name: Build
run: cargo build --workspace --all-targets --all-features
- name: Run Tests
run: cargo test --workspace --all-targets --all-features
test-docs:
name: Check Docs - ${{ matrix.crate }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate:
- dapr
- dapr-macros
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs -p ${{ matrix.crate }}
publish-dry:
name: Publish Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
crate:
- dapr
- dapr-macros
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.PROTOC_VERSION }}
- uses: actions/checkout@v4
- name: cargo publish - ${{ matrix.crate }}
run: cargo publish --manifest-path ${{ matrix.crate }}/Cargo.toml --dry-run
publish:
name: Publish
runs-on: ubuntu-latest
needs: [test-docs, lint, build, publish-dry]
if: startswith(github.ref, 'refs/tags/v')
strategy:
fail-fast: false
matrix:
crate:
- dapr
- dapr-macros
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.PROTOC_VERSION }}
- uses: actions/checkout@v4
- name: cargo publish - ${{ matrix.crate }}
run: cargo publish --manifest-path ${{ matrix.crate }}/Cargo.toml --token ${{ env.CARGO_TOKEN }}