|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +on: |
| 19 | + pull_request: |
| 20 | + types: [opened, synchronize, reopened, ready_for_review] |
| 21 | + paths-ignore: |
| 22 | + - '**.md' |
| 23 | + - '.gitignore' |
| 24 | + push: |
| 25 | + branches: |
| 26 | + - main |
| 27 | + paths-ignore: |
| 28 | + - '**.md' |
| 29 | + - '.gitignore' |
| 30 | + workflow_dispatch: |
| 31 | + |
| 32 | +name: CI |
| 33 | + |
| 34 | +env: |
| 35 | + RUST_TOOLCHAIN: stable |
| 36 | + |
| 37 | +jobs: |
| 38 | + typos: |
| 39 | + name: Spell Check with Typos |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@v3 |
| 43 | + - uses: crate-ci/[email protected] |
| 44 | + |
| 45 | + check: |
| 46 | + name: Check |
| 47 | + if: github.event.pull_request.draft == false |
| 48 | + runs-on: ubuntu-latest |
| 49 | + timeout-minutes: 60 |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v3 |
| 52 | + - uses: dtolnay/rust-toolchain@master |
| 53 | + with: |
| 54 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 55 | + - name: Rust Cache |
| 56 | + uses: Swatinem/rust-cache@v2 |
| 57 | + - name: Run cargo check |
| 58 | + run: cargo check --workspace --all-targets |
| 59 | + |
| 60 | + # No examples yet |
| 61 | + |
| 62 | + # examples: |
| 63 | + # name: Examples |
| 64 | + # if: github.event.pull_request.draft == false |
| 65 | + # runs-on: ubuntu-latest |
| 66 | + # timeout-minutes: 60 |
| 67 | + # steps: |
| 68 | + # - uses: actions/checkout@v3 |
| 69 | + # - uses: dtolnay/rust-toolchain@master |
| 70 | + # with: |
| 71 | + # toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 72 | + # - name: Rust Cache |
| 73 | + # uses: Swatinem/rust-cache@v2 |
| 74 | + # - name: Run cargo examples |
| 75 | + # run: cargo run --example datafusion_integration --all-features |
| 76 | + |
| 77 | + toml: |
| 78 | + name: Toml Check |
| 79 | + if: github.event.pull_request.draft == false |
| 80 | + runs-on: ubuntu-latest |
| 81 | + timeout-minutes: 60 |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v3 |
| 84 | + - uses: dtolnay/rust-toolchain@master |
| 85 | + with: |
| 86 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 87 | + - name: Rust Cache |
| 88 | + uses: Swatinem/rust-cache@v2 |
| 89 | + - name: Install taplo |
| 90 | + run: cargo install taplo-cli --version ^0.8 --locked |
| 91 | + - name: Run taplo |
| 92 | + run: taplo format --check |
| 93 | + |
| 94 | + fmt: |
| 95 | + name: Rustfmt |
| 96 | + if: github.event.pull_request.draft == false |
| 97 | + runs-on: ubuntu-latest |
| 98 | + timeout-minutes: 60 |
| 99 | + steps: |
| 100 | + - uses: actions/checkout@v3 |
| 101 | + - uses: dtolnay/rust-toolchain@master |
| 102 | + with: |
| 103 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 104 | + components: rustfmt |
| 105 | + - name: Rust Cache |
| 106 | + uses: Swatinem/rust-cache@v2 |
| 107 | + - name: Run cargo fmt |
| 108 | + run: cargo fmt --all -- --check |
| 109 | + |
| 110 | + clippy: |
| 111 | + name: Clippy |
| 112 | + if: github.event.pull_request.draft == false |
| 113 | + runs-on: ubuntu-latest |
| 114 | + timeout-minutes: 60 |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v3 |
| 117 | + - uses: dtolnay/rust-toolchain@master |
| 118 | + with: |
| 119 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 120 | + components: clippy |
| 121 | + - name: Rust Cache |
| 122 | + uses: Swatinem/rust-cache@v2 |
| 123 | + - name: Run cargo clippy |
| 124 | + run: cargo clippy --workspace --all-targets -- -D warnings |
| 125 | + |
| 126 | + license-header: |
| 127 | + name: Check license header |
| 128 | + if: github.event.pull_request.draft == false |
| 129 | + runs-on: ubuntu-latest |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v4 |
| 132 | + - name: Check license headers |
| 133 | + uses: korandoru/hawkeye@v5 |
| 134 | + |
| 135 | + cargo-deny: |
| 136 | + name: Cargo Deny License Check |
| 137 | + if: github.event.pull_request.draft == false |
| 138 | + runs-on: ubuntu-latest |
| 139 | + steps: |
| 140 | + - uses: actions/checkout@v3 |
| 141 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
| 142 | + with: |
| 143 | + command: check license |
| 144 | + |
| 145 | + coverage: |
| 146 | + if: github.event.pull_request.draft == false |
| 147 | + runs-on: ubuntu-latest |
| 148 | + timeout-minutes: 60 |
| 149 | + needs: [clippy] |
| 150 | + steps: |
| 151 | + - uses: actions/checkout@v3 |
| 152 | + - uses: KyleMayes/install-llvm-action@v1 |
| 153 | + with: |
| 154 | + version: "14.0" |
| 155 | + - name: Install toolchain |
| 156 | + uses: dtolnay/rust-toolchain@master |
| 157 | + with: |
| 158 | + toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 159 | + components: llvm-tools-preview |
| 160 | + - name: Rust Cache |
| 161 | + uses: Swatinem/rust-cache@v2 |
| 162 | + - name: Install latest nextest release |
| 163 | + uses: taiki-e/install-action@nextest |
| 164 | + - name: Install cargo-llvm-cov |
| 165 | + uses: taiki-e/install-action@cargo-llvm-cov |
| 166 | + - name: Collect coverage data |
| 167 | + run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info --all-features |
| 168 | + env: |
| 169 | + CARGO_BUILD_RUSTFLAGS: "-C link-arg=-fuse-ld=lld" |
| 170 | + RUST_BACKTRACE: 1 |
| 171 | + CARGO_INCREMENTAL: 0 |
| 172 | + UNITTEST_LOG_DIR: "__unittest_logs" |
0 commit comments