Skip to content

Commit da761bf

Browse files
committed
first commit
0 parents  commit da761bf

101 files changed

Lines changed: 45639 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Summary
2+
3+
-
4+
5+
## Test plan
6+
7+
- [ ] `cargo fmt --check`
8+
- [ ] `cargo clippy --all-targets --all-features -- -D warnings`
9+
- [ ] `cargo test`
10+
- [ ] `cd contracts && forge test`
11+
12+
## Security
13+
14+
- [ ] No secrets committed (`.env`, private keys, RPC API keys)
15+
- [ ] Docs updated if configs/behavior changed
16+

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
rust:
10+
name: Rust (fmt, clippy, test)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
components: rustfmt, clippy
17+
- name: cargo fmt
18+
run: cargo fmt --check
19+
- name: cargo clippy
20+
run: cargo clippy --all-targets --all-features -- -D warnings
21+
- name: cargo test
22+
run: cargo test
23+
24+
foundry:
25+
name: Foundry (build, test)
26+
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: contracts
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Install Foundry
33+
uses: foundry-rs/foundry-toolchain@v1
34+
with:
35+
version: nightly
36+
- name: forge build
37+
run: forge build
38+
- name: forge test
39+
run: forge test -vv
40+

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: dtolnay/rust-toolchain@stable
19+
with:
20+
components: rustfmt
21+
22+
- name: Build (release)
23+
run: |
24+
cargo build --release -p gapura
25+
cargo build --release -p sentinel
26+
27+
- name: Prepare artifacts
28+
run: |
29+
mkdir -p dist
30+
cp target/release/gapura dist/gapura-linux-x86_64
31+
cp target/release/gapura-sentinel dist/gapura-sentinel-linux-x86_64
32+
(cd dist && sha256sum * > SHA256SUMS)
33+
34+
- name: Create GitHub Release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
files: |
38+
dist/*
39+

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.DS_Store
2+
Thumbs.db
3+
4+
# Editors
5+
.idea/
6+
.vscode/
7+
8+
# Env / secrets
9+
.env
10+
**/.env
11+
*.env
12+
!.env.example
13+
14+
# Rust
15+
target/
16+
**/target/
17+
Cargo.lock.bak
18+
*.rs.bk
19+
20+
# Foundry
21+
contracts/out/
22+
contracts/cache/
23+
contracts/broadcast/
24+
25+
# Logs
26+
*.log

CONTRIBUTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Contributing
2+
3+
Terima kasih sudah mau kontribusi ke Gapura.
4+
5+
## Dev setup
6+
7+
- Rust toolchain (stable)
8+
- Foundry (`forge`, `anvil`, `cast`)
9+
10+
## Commands
11+
12+
### Rust (workspace root)
13+
14+
```bash
15+
cargo fmt --check
16+
cargo clippy --all-targets --all-features -- -D warnings
17+
cargo test
18+
```
19+
20+
### Contracts (Foundry)
21+
22+
```bash
23+
cd contracts
24+
forge fmt
25+
forge build
26+
forge test
27+
```
28+
29+
### Smoke test lokal
30+
31+
```bash
32+
./scripts/dev-smoke.sh
33+
```
34+
35+
## Pull request checklist
36+
37+
- [ ] `cargo fmt --check` lulus
38+
- [ ] `cargo clippy ... -D warnings` lulus
39+
- [ ] `cargo test` lulus
40+
- [ ] `cd contracts && forge test` lulus
41+
- [ ] Update docs bila ada perubahan config / behavior (`docs/`)
42+
- [ ] Tidak ada secret yang ikut ke commit (`.env`, private key, RPC API keys)
43+

0 commit comments

Comments
 (0)