Rust-CI #5302
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust-CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| merge_group: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Cancel in-progress runs on new commits to same PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| rust: ${{ steps.filter.outputs.rust }} | |
| steps: | |
| - uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| filters: | | |
| rust: | |
| - 'rust/**' | |
| - '.github/workflows/rust-ci.yml' | |
| test_and_coverage: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| folder: | |
| - otap-dataflow | |
| - experimental/query_abstraction | |
| - experimental/query_engine | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: stable | |
| - name: install cargo-llvm-cov and nextest | |
| uses: taiki-e/install-action@3575e532701a5fc614b0c842e4119af4cc5fd16d # v2.62.60 | |
| with: | |
| tool: cargo-llvm-cov,cargo-nextest | |
| - name: Build the test collector | |
| run: make otelarrowcol | |
| - name: Run tests with coverage | |
| run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info | |
| working-directory: ./rust/${{ matrix.folder }} | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| fail_ci_if_error: true | |
| fmt: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| folder: | |
| - otap-dataflow | |
| - experimental/query_abstraction | |
| - experimental/query_engine | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: nightly | |
| components: rustfmt | |
| - name: cargo fmt ${{ matrix.folder }} | |
| run: cargo fmt --all -- --check | |
| working-directory: ./rust/${{ matrix.folder }} | |
| clippy: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| folder: | |
| - otap-dataflow | |
| - experimental/query_abstraction | |
| - experimental/query_engine | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| - name: cargo clippy ${{ matrix.folder }} | |
| run: | | |
| cargo clippy --all-targets --all-features --workspace -- -D warnings | |
| working-directory: ./rust/${{ matrix.folder }} | |
| deny: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| folder: | |
| - otap-dataflow | |
| - experimental/query_abstraction | |
| - experimental/query_engine | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: stable | |
| - name: advisories | |
| if: '!cancelled()' | |
| uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14 | |
| with: | |
| command: check advisories | |
| manifest-path: ./rust/${{ matrix.folder }}/Cargo.toml | |
| - name: licenses | |
| if: '!cancelled()' | |
| uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14 | |
| with: | |
| command: check licenses | |
| manifest-path: ./rust/${{ matrix.folder }}/Cargo.toml | |
| - name: bans | |
| if: '!cancelled()' | |
| uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14 | |
| with: | |
| command: check bans | |
| manifest-path: ./rust/${{ matrix.folder }}/Cargo.toml | |
| - name: sources | |
| if: '!cancelled()' | |
| uses: EmbarkStudios/cargo-deny-action@76cd80eb775d7bbbd2d80292136d74d39e1b4918 # v2.0.14 | |
| with: | |
| command: check sources | |
| manifest-path: ./rust/${{ matrix.folder }}/Cargo.toml | |
| docs: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| folder: | |
| - otap-dataflow | |
| - experimental/query_abstraction | |
| - experimental/query_engine | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: stable | |
| - name: cargo doc ${{ matrix.folder }} | |
| run: cargo doc --no-deps | |
| working-directory: ./rust/${{ matrix.folder }} | |
| structure_check: | |
| needs: check-changes | |
| if: needs.check-changes.outputs.rust == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Only otap-dataflow has a structure check | |
| folder: [otap-dataflow] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| submodules: true | |
| - uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 | |
| with: | |
| toolchain: stable | |
| - name: cargo xtask ${{ matrix.folder }} | |
| run: cargo xtask structure-check | |
| working-directory: ./rust/${{ matrix.folder }} | |
| document-build-options: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Document Build Options | |
| run: | | |
| echo "## :bulb: Build Options" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "- Add the label \`cargobench\` to your PR to run micro benchmarks." >> $GITHUB_STEP_SUMMARY | |
| echo "- More info: [link to docs](https://github.com/open-telemetry/otel-arrow/blob/main/CONTRIBUTING.md#micro-benchmarks)" >> $GITHUB_STEP_SUMMARY |