Skip to content

Commit 653fb9a

Browse files
committed
initial commit
fix add clang bump gha versions simple gha fix gha add output for docker fs break a ex a
0 parents  commit 653fb9a

File tree

10 files changed

+419
-0
lines changed

10 files changed

+419
-0
lines changed

.dockerignore

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

.github/workflows/docker.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and publish a Docker image to ghcr.io
2+
on:
3+
release:
4+
types: [ published ]
5+
6+
jobs:
7+
docker_publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: 'Checkout GitHub Action'
11+
uses: actions/checkout@v4
12+
13+
- name: Set up QEMU
14+
uses: docker/setup-qemu-action@v3
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Docker meta
20+
id: meta
21+
uses: docker/metadata-action@v4
22+
with:
23+
images: ghcr.io/seddonm1/sqlite-bench
24+
flavor: latest=true
25+
tags: |
26+
type=semver,pattern={{version}}
27+
28+
- name: Login to image repository
29+
if: github.ref_type == 'tag'
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.PACKAGES_GITHUB_TOKEN }}
35+
36+
- name: Build and push
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: .
40+
file: Dockerfile
41+
platforms: linux/amd64,linux/arm64
42+
push: ${{ github.ref_type == 'tag' }}
43+
tags: ${{ steps.meta.outputs.tags }}
44+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/rust.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Test Workspace on AMD64 Rust ${{ matrix.rust }}
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
arch: [amd64]
11+
rust: [stable]
12+
container:
13+
image: ${{ matrix.arch }}/rust
14+
env:
15+
# Disable full debug symbol generation to speed up CI build and keep memory down
16+
# "1" means line tables only, which is useful for panic tracebacks.
17+
RUSTFLAGS: "-C debuginfo=1"
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: true
22+
- name: Cache Cargo
23+
uses: actions/cache@v4
24+
with:
25+
path: /home/runner/.cargo
26+
key: cargo-cache-
27+
- name: Cache Rust dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: /home/runner/target
31+
key: target-cache-
32+
- name: Setup Rust toolchain
33+
run: |
34+
rustup toolchain install ${{ matrix.rust }}
35+
rustup default ${{ matrix.rust }}
36+
rustup component add rustfmt
37+
rustup component add clippy
38+
apt update
39+
apt install -y clang
40+
- name: Run tests
41+
run: |
42+
cargo test
43+
- name: Run format
44+
run: cargo fmt --all -- --check
45+
- name: Run clippy
46+
run: cargo clippy --all-targets --workspace -- -D warnings
47+

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
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
12+
13+
# MSVC Windows builds of rustc generate these, which store debugging information
14+
*.pdb
15+
16+
.DS_Store

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
max_width = 150

Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "sqlite-bench"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
anyhow = "1.0.86"
8+
clap = { version = "4.5.9", features = ["derive"] }
9+
indicatif = "0.17.8"
10+
itertools = "0.13.0"
11+
rand = "0.8.5"
12+
rusqlite = { git = "https://github.com/seddonm1/rusqlite", branch = "begin-concurrent", features = [
13+
"bundled",
14+
"buildtime_bindgen",
15+
] }
16+
serde = { version = "1.0.204", features = ["derive"] }
17+
serde_json = "1.0.120"
18+
19+
[profile.release]
20+
codegen-units = 1
21+
opt-level = 3

Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM rust:1.79.0 AS build-env
2+
RUN apt update \
3+
&& apt install -y \
4+
clang
5+
WORKDIR /app
6+
COPY . /app
7+
RUN cargo build --release
8+
9+
FROM gcr.io/distroless/cc
10+
COPY --from=build-env /app/target/release/sqlite-bench /
11+
ENTRYPOINT ["./sqlite-bench"]
12+
CMD ["--help"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Mike Seddon
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# sqlite-bench
2+
3+
A project to test SQLite Transaction behavior.

0 commit comments

Comments
 (0)