Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 522a357b02 | |||
| 286a543147 | |||
| 3bbcb0cbaa | |||
| 0de646aedf | |||
| 72ae029eb2 | |||
| 781f3244d3 | |||
| 37936e924d | |||
| 34ae98ab6a | |||
| 42612788d3 | |||
| e1a364274d |
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[build]
|
||||
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
|
||||
40
.ci.yml
Normal file
40
.ci.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Rust
|
||||
run: |
|
||||
rustup default stable
|
||||
rustc --version
|
||||
cargo --version
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
- name: Run tests
|
||||
run: cargo test
|
||||
- name: Clippy
|
||||
run: cargo clippy -- -D warnings
|
||||
release:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Release
|
||||
run: |
|
||||
cargo build --release --locked
|
||||
- name: Create Release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
target/release/env-guard
|
||||
title: ${{ github.ref_name }}
|
||||
body: "Release ${{ github.ref_name }}"
|
||||
19
.envguard.toml
Normal file
19
.envguard.toml
Normal file
@@ -0,0 +1,19 @@
|
||||
[tool.envguard]
|
||||
name = "env-guard"
|
||||
version = "0.1.0"
|
||||
description = "A comprehensive .env file guardian tool for validation, scanning, and secrets detection"
|
||||
|
||||
[dependencies]
|
||||
clap = { version = "4.4", features = ["derive"] }
|
||||
anyhow = "1.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
regex = "1.10"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = []
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
||||
opt-level = 3
|
||||
@@ -2,65 +2,39 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions/setup-rust@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
cache: true
|
||||
|
||||
- name: Setup Rust
|
||||
run: |
|
||||
rustup default stable
|
||||
rustc --version
|
||||
cargo --version
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
|
||||
- name: Run tests
|
||||
run: cargo test --all
|
||||
|
||||
- name: Run clippy
|
||||
run: cargo clippy --all --all-features -- -D warnings
|
||||
|
||||
- name: Check formatting
|
||||
run: cargo fmt -- --check
|
||||
|
||||
binary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions/setup-rust@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
cache: true
|
||||
|
||||
- name: Build binary
|
||||
run: cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
- name: Upload binary artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: env-guard-linux-amd64
|
||||
path: target/x86_64-unknown-linux-musl/release/env-guard
|
||||
|
||||
run: cargo test
|
||||
- name: Clippy
|
||||
run: cargo clippy -- -D warnings
|
||||
release:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
needs: binary
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Release
|
||||
run: |
|
||||
cargo build --release --locked
|
||||
- name: Create Release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
target/x86_64-unknown-linux-musl/release/env-guard
|
||||
target/release/env-guard
|
||||
title: ${{ github.ref_name }}
|
||||
body: "Release ${{ github.ref_name }} of env-guard"
|
||||
body: "Release ${{ github.ref_name }}"
|
||||
|
||||
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup Rust
|
||||
run: |
|
||||
rustup default stable
|
||||
rustc --version
|
||||
cargo --version
|
||||
- name: Build
|
||||
run: cargo build --release
|
||||
- name: Run tests
|
||||
run: cargo test
|
||||
- name: Clippy
|
||||
run: cargo clippy -- -D warnings
|
||||
release:
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build Release
|
||||
run: |
|
||||
cargo build --release --locked
|
||||
- name: Create Release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |
|
||||
target/release/env-guard
|
||||
title: ${{ github.ref_name }}
|
||||
body: "Release ${{ github.ref_name }}"
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,19 +1,22 @@
|
||||
# Cargo
|
||||
target/
|
||||
*.lock
|
||||
|
||||
# Environment
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
# Secrets
|
||||
*.pem
|
||||
|
||||
test_*.txt
|
||||
test_*.env
|
||||
|
||||
*.log
|
||||
*.key
|
||||
|
||||
Reference in New Issue
Block a user