Visitar URL original
Initialize project · PowerSQL/PowerSQL@41e6216 · GitHub
Skip to content

Commit 41e6216

Browse files
committed
Initialize project
1 parent c62a2f4 commit 41e6216

9 files changed

Lines changed: 105 additions & 1 deletion

File tree

‎.github/workflows/rust.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Rust
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Build
13+
run: cargo build --verbose
14+
- name: Run style check
15+
run: cargo clippy
16+
- name: Run tests
17+
run: cargo test --verbose

‎.gitignore‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
# Generated by Cargo
3+
# will have compiled files and executables
4+
/target/
5+
6+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
7+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
8+
Cargo.lock
9+
10+
# These are backup files generated by rustfmt
11+
**/*.rs.bk

‎.pre-commit-config.yaml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v3.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: end-of-file-fixer
7+
- repo: local
8+
hooks:
9+
- id: fmt
10+
name: fmt
11+
description: Format files with rustfmt.
12+
entry: rustfmt --edition 2018 --
13+
language: system
14+
files: \.rs$
15+
args: []
16+
- id: cargo-check
17+
name: cargo check
18+
description: Check the package for errors.
19+
entry: cargo check
20+
language: system
21+
files: \.rs$
22+
pass_filenames: false
23+
- id: cargo-test
24+
name: cargo test
25+
description: Run tests
26+
entry: cargo test
27+
language: system
28+
files: \.rs$
29+
pass_filenames: false
30+
- id: clippy
31+
name: clippy
32+
description: Lint rust sources
33+
entry: cargo clippy -- -D warnings
34+
language: system
35+
files: \.rs$
36+
pass_filenames: false

‎Cargo.toml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "powersql"
3+
version = "0.1.0"
4+
authors = ["Dandandan <danielheres@gmail.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
11+
[dev-dependencies]
12+
criterion = "0.3"
13+
14+
[[bench]]
15+
name = "bench"
16+
harness = false

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# PowerSQL
1+
# PowerSQL

‎benches/bench.rs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2+
3+
fn fibonacci(n: u64) -> u64 {
4+
match n {
5+
0 => 1,
6+
1 => 1,
7+
n => fibonacci(n - 1) + fibonacci(n - 2),
8+
}
9+
}
10+
11+
fn criterion_benchmark(c: &mut Criterion) {
12+
c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20))));
13+
}
14+
15+
criterion_group!(benches, criterion_benchmark);
16+
criterion_main!(benches);

‎ci/postgres.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /bin/bash
2+
docker build -t postgres -f postgres/Dockerfile .
3+
4+
docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres

‎ci/postgres/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM postgres:12.2

‎src/main.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pub fn main() {
2+
println!("Running")
3+
}

0 commit comments

Comments
 (0)