Skip to content

Rust Tests

Rust Tests #99

Workflow file for this run

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# To learn more about GitHub Actions in Apache Beam check the CI.md
name: Rust Tests
on:
workflow_dispatch:
schedule:
- cron: "10 2 * * *"
push:
branches: ["master", "release-*", "rust_sdk"]
tags: ["v*"]
pull_request:
branches: ["master", "release-*", "rust_sdk"]
tags: ["v*"]
paths: ["sdks/rust/**"]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
rust_unit_tests:
name: "Rust Unit Tests"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# TODO: the test fails under Windows platform (for directory separator in `--skip target/debug`. add window-latest and fix the build
os: [ubuntu-latest, macos-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install stable toolchain and cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run Cargo test
working-directory: ./sdks/rust
run: cargo test -- --skip target/debug
clippy:
name: "Rust Clippy"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install stable toolchain and cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run Clippy
working-directory: ./sdks/rust
run: cargo clippy
fmt:
name: "Rust Formatting Check"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install stable toolchain and cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run Cargo formatting check
working-directory: ./sdks/rust
run: cargo fmt --all -- --check