Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit 6b7f093

Browse files
authored
Merge pull request #1 from base/setup-project
feat: initial project setup
2 parents 32d0759 + 3852ce7 commit 6b7f093

File tree

16 files changed

+4016
-0
lines changed

16 files changed

+4016
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
target/
2+
.git/
3+
.github/
4+
.gitignore
5+
README.md

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
UPSTREAM_WS=ws://upstreamurl.com/rs
2+
MAXIMUM_CONCURRENT_CONNECTIONS=2
3+
LOG_LEVEL=debug

.github/workflows/ci.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust toolchain
20+
uses: dtolnay/rust-toolchain@master
21+
with:
22+
toolchain: "1.85"
23+
components: rustfmt, clippy
24+
25+
- name: Cache dependencies
26+
uses: Swatinem/rust-cache@v2
27+
28+
- name: Check formatting
29+
run: cargo fmt --all -- --check
30+
31+
- name: Run clippy
32+
run: cargo clippy -- -D warnings
33+
34+
- name: Run build
35+
run: cargo build
36+
37+
- name: Run tests
38+
run: cargo test --all-features
39+
40+
- name: Check for common mistakes
41+
run: cargo check
42+
43+
security-audit:
44+
name: Security Audit
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install cargo-audit
50+
run: cargo install cargo-audit
51+
52+
- name: Run security audit
53+
run: cargo audit
54+
55+
docker:
56+
name: Docker Build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Set up Docker Buildx
62+
uses: docker/setup-buildx-action@v3
63+
64+
- name: Build Docker image
65+
uses: docker/build-push-action@v5
66+
with:
67+
context: .
68+
push: false
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max

.github/workflows/docker.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Tag Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
tags:
8+
- 'v*'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Log into the Container registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ${{ env.REGISTRY }}
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Extract metadata for the Docker image
29+
id: meta
30+
uses: docker/metadata-action@v4
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Build and push the Docker image
38+
uses: docker/build-push-action@v4
39+
with:
40+
context: .
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
44+
platforms: linux/amd64,linux/arm64

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/target/
2+
/.idea/
3+
/.env

0 commit comments

Comments
 (0)