.github/workflows/rust.yml
# 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.
name: Rust CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1
CI: true
jobs:
license:
name: License headers
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Check license header
uses: apache/skywalking-eyes@61275cc80d0798a405cb070f7d3a8aaf7cf2c2c1 # v0.8.0
with:
config: .github/.licenserc.yaml
rust:
name: Ubuntu, Rust from rust-toolchain.toml
runs-on: ubuntu-24.04
env:
GAR_TEST_DATA: ${{ github.workspace }}/testing/
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest@0.9.114,cargo-machete@0.9.1,taplo-cli@0.10.0,cargo-deny@0.18.9
- name: Spell check
uses: crate-ci/typos@v1.29.4
- name: TOML check
run: taplo fmt --check --diff
- name: Rustfmt check
run: cargo fmt --all --check
- name: Clippy check
run: cargo clippy --all-features --tests --no-deps
- name: Machete check
run: cargo machete
- name: Deny check
run: cargo deny check
- name: Test
run: |
cargo nextest run
cargo nextest run --all-features
cargo test --all-features --doc
- name: Build docs
run: cargo doc --lib --no-deps --all-features