Skip to content

Commit

Permalink
Create project
Browse files Browse the repository at this point in the history
  • Loading branch information
adityauj committed Sep 11, 2024
0 parents commit cbaf6c5
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-C", "target-cpu=native"]
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on: [push, pull_request]

name: Quickstart

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
# continue-on-error: true # WARNING: only for this example, remove it!
with:
command: check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
7 changes: 7 additions & 0 deletions Cargo.lock

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

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "TheRustBandwidthBenchmark"
version = "0.1.0"
edition = "2021"

[dependencies]

[[bin]]
name = "bench"
path = "src/main.rs"
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
TARGET = ./bench
VERSION = 1.0.0
GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development')
CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S")
LD_FLAGS = '-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}'

.PHONY: clean test check $(TARGET)

.NOTPARALLEL:

$(TARGET):
$(info ===> BUILD bench)
@cargo b --release
@cp ./target/release/$(TARGET) $(TARGET)

# swagger:
# $(info ===> GENERATE swagger)
# @go run github.com/swaggo/swag/cmd/swag init -d ./internal/api,./internal/util -g api.go -o ./api
# @mv ./api/docs.go ./internal/api/docs.go

clean:
$(info ===> CLEAN)
@cargo clean
@rm -f $(TARGET)
@rm perf.data perf.data.old flamegraph.svg

test:
$(info ===> TESTING)
@cargo clean
@cargo b --release
@cargo test

check:
$(info ===> CHECKING)
@cargo clean
@cargo check
Binary file added bench
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

0 comments on commit cbaf6c5

Please sign in to comment.