Skip to content

Commit a60bcf4

Browse files
committed
cargo + GH actions + taplo
add a test update Cargo.toml package metadata forgot to add #[test] add licenserc.toml add deny.toml only require license headers on .rs and .toml files add a license to the Cargo.toml newlines at EOF
1 parent d2054c6 commit a60bcf4

File tree

11 files changed

+372
-2
lines changed

11 files changed

+372
-2
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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"

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ Cargo.lock
1818
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
1919
# and can be added to the global gitignore or merged into this file. For a more nuclear
2020
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
21-
#.idea/
21+
#.idea/
22+
23+
# Added by cargo
24+
25+
/target

Cargo.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
[package]
19+
name = "datafusion-materialized-views"
20+
version = "0.1.0"
21+
edition = "2021"
22+
homepage = "https://github.com/datafusion-contrib/datafusion-materialized-views"
23+
repository = "https://github.com/datafusion-contrib/datafusion-materialized-views"
24+
authors = ["Matthew Cramerus <[email protected]>"]
25+
license = "Apache-2.0"
26+
description = "Materialized Views & Query Rewriting in DataFusion"
27+
keywords = ["arrow", "arrow-rs", "datafusion"]
28+
rust-version = "1.73"
29+
30+
[dependencies]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# datafusion-materialized-view
1+
# datafusion-materialized-views

deny.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
[licenses]
19+
allow = ["Apache-2.0"]
20+
version = 2

licenserc.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
headerPath = "Apache-2.0-ASF.txt"
19+
20+
includes = ["**/*.rs", "**/*.toml"]

src/lib.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
/// Code for incremental view maintenance.
19+
mod materialized;
20+
21+
/// An implementation of Query Rewriting, an optimization that rewrites queries to make use of materialized views.
22+
mod rewrite;
23+
24+
#[cfg(test)]
25+
mod test {
26+
#[test]
27+
fn test_it_works() {}
28+
}

src/materialized.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.

src/rewrite.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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.

0 commit comments

Comments
 (0)