Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
swift-tests:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Swift Test with Coverage
run: swift test --enable-code-coverage
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install CLI deps
run: cd cli && bun install
- name: Test CLI
run: cd cli && bun test
- name: Install Guardian deps
run: cd guardian && bun install
- name: Test Guardian
run: cd guardian && bun test
- name: Lint CLI
run: cd cli && bunx biome check --error-on-warnings .
- name: Lint Guardian
run: cd guardian && bunx biome check --error-on-warnings .
- name: Gitleaks
run: |
GITLEAKS_VERSION="8.22.1"
curl -sSfL -o /tmp/gitleaks.tar.gz \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
tar -xzf /tmp/gitleaks.tar.gz -C /usr/local/bin gitleaks
gitleaks detect --config .gitleaks.toml --source . -v --no-banner
- name: OSV-Scanner
run: |
OSV_VERSION="2.3.5"
curl -sSfL -o /usr/local/bin/osv-scanner \
"https://github.com/google/osv-scanner/releases/download/v${OSV_VERSION}/osv-scanner_linux_amd64"
chmod +x /usr/local/bin/osv-scanner
osv-scanner scan --lockfile=cli/bun.lock --lockfile=guardian/bun.lock --config=osv-scanner.toml || true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ DerivedData/
Package.resolved
node_modules/
bun.lock
!guardian/bun.lock
.superset/
14 changes: 14 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Gitleaks configuration for Codo
# https://github.com/gitleaks/gitleaks

title = "Codo Gitleaks Config"

[allowlist]
description = "Global allowlist"
paths = [
'''(^|/)\.build/''',
'''(^|/)node_modules/''',
'''(^|/)bun\.lock$''',
'''\.png$''',
'''\.icns$''',
]
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "=== L2: Swift Lint ==="
swiftlint lint --strict --quiet

echo "=== L2: TS Lint ==="
cd cli && bunx biome check . && cd ..
cd guardian && bunx biome check . && cd ..
cd cli && bunx biome check --error-on-warnings . && cd ..
cd guardian && bunx biome check --error-on-warnings . && cd ..

echo "✓ pre-commit passed"
4 changes: 2 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ echo "=== L2: Swift Lint ==="
swiftlint lint --strict --quiet

echo "=== L2: TS Lint ==="
cd cli && bunx biome check . && cd ..
cd guardian && bunx biome check . && cd ..
cd cli && bunx biome check --error-on-warnings . && cd ..
cd guardian && bunx biome check --error-on-warnings . && cd ..

echo "=== L3: Integration Tests ==="
if [ -f scripts/integration-test.sh ]; then
Expand Down
6 changes: 6 additions & 0 deletions cli/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true
},
"organizeImports": {
"enabled": true
}
}
4 changes: 4 additions & 0 deletions cli/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[test]
coverageThreshold = { line = 50.0, function = 50.0 }
coverage = true
coverageSkipTestFiles = true
6 changes: 6 additions & 0 deletions guardian/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true
},
"organizeImports": {
"enabled": true
}
}
96 changes: 96 additions & 0 deletions guardian/bun.lock

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

4 changes: 4 additions & 0 deletions guardian/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[test]
coverageThreshold = { line = 50.0, function = 50.0 }
coverage = true
coverageSkipTestFiles = true
5 changes: 5 additions & 0 deletions osv-scanner.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# OSV-Scanner configuration for Codo
# https://google.github.io/osv-scanner/

[[PackageLockfileConfig]]
Lockfile = "guardian/bun.lock"
Loading