Skip to content

Commit

Permalink
Merge pull request #4 from saint1991/ci
Browse files Browse the repository at this point in the history
Add GitHub Actions workflows
  • Loading branch information
saint1991 authored Nov 2, 2024
2 parents 8b74afa + c38110a commit 3f114d7
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 39 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "docker build and push"

on:
pull_request:
paths:
- .github/workflows/docker.yml
- proto/**.proto
- src/**
- Cargo.toml
- Cargo.lock
push:
tags:
- '*'

env:
PUBLISH: ${{ github.ref_type == 'tags' }}
IMAGE: saint1991/gduck
TAG: ${{ github.ref_type == 'tags' && github.ref_name || github.sha }}

jobs:
docker_build:
runs-on: ubuntu-latest
steps:
- name: check publish
run: echo '${{ env.PUBLISH }}'
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
push: ${{ env.PUBLISH == 'true' }}
cache-from: ${{ format('type=registry,ref={0}:{1}', env.IMAGE, 'buildcache') }}
cache-to: ${{ format('type=registry,ref={0}:{1},mode=max', env.IMAGE, 'buildcache') }}
tags: |
${{ format('{0}:{1}', env.IMAGE, 'latest') }}
${{ format('{0}:{1}', env.IMAGE, env.TAG) }}
21 changes: 21 additions & 0 deletions .github/workflows/lint-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: check-rust

on:
pull_request:
paths:
- .github/workflows/lint-rust.yml
- **.rs
- Cargo.toml
- Cargo.lock

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Rust format check
run: cargo fmt --check
105 changes: 76 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[package]
name = "gduck-rpc"
name = "gduck"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = { version = "1.0.90", features = ["backtrace", "std"] }
anyhow = { version = "1.0.92", features = ["backtrace", "std"] }
async-stream = { version = "0.3.6" }
chrono = { version = "0.4.38" }
clap = { version = "4.5.20", features = ["derive"] }
duckdb = { version = "1.1.1", features = ["bundled", "chrono"] }
env_logger = { version = "0.11.5" }
futures-core = { version = "0.3.31" }
log = { version = "0.4.22" }
prost = { version = "0.13.3" }
prost-types = { version = "0.13.3" }
thiserror = { version = "1.0.64" }
tokio = { version = "1.40.0", features = ["rt-multi-thread", "macros", "sync" ] }
thiserror = { version = "1.0.66" }
tokio = { version = "1.41.0", features = ["rt-multi-thread", "macros", "sync" ] }
tokio-stream = { version = "0.1.16" }
tonic = { version = "0.12.3" }

Expand Down
Loading

0 comments on commit 3f114d7

Please sign in to comment.