Major refactor: Remove debos integration, add particle-os CLI system, implement OSTree stages, and create comprehensive build pipeline
Some checks failed
particle-os CI / Test particle-os (push) Failing after 1s
particle-os CI / Integration Test (push) Has been skipped
particle-os CI / Security & Quality (push) Failing after 1s
Test particle-os Basic Functionality / test-basic (push) Failing after 1s
Tests / test (1.21.x) (push) Failing after 2s
Tests / test (1.22.x) (push) Failing after 1s
particle-os CI / Build and Release (push) Has been skipped
Some checks failed
particle-os CI / Test particle-os (push) Failing after 1s
particle-os CI / Integration Test (push) Has been skipped
particle-os CI / Security & Quality (push) Failing after 1s
Test particle-os Basic Functionality / test-basic (push) Failing after 1s
Tests / test (1.21.x) (push) Failing after 2s
Tests / test (1.22.x) (push) Failing after 1s
particle-os CI / Build and Release (push) Has been skipped
This commit is contained in:
parent
c7e335d60f
commit
d2d4c2e4e7
101 changed files with 13234 additions and 6342 deletions
208
.github/workflows/ci.yml
vendored
Normal file
208
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
name: particle-os CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
env:
|
||||
GO_VERSION: '1.21'
|
||||
QEMU_VERSION: 'latest'
|
||||
|
||||
jobs:
|
||||
# Test and validate particle-os
|
||||
test:
|
||||
name: Test particle-os
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-utils
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
cd bib
|
||||
go test -v ./...
|
||||
|
||||
- name: Build particle-os
|
||||
run: |
|
||||
cd bib
|
||||
go build -o particle-os cmd/particle_os/main.go
|
||||
|
||||
- name: Test CLI
|
||||
run: |
|
||||
cd bib
|
||||
./particle-os --help
|
||||
./particle-os version
|
||||
./particle-os list
|
||||
|
||||
- name: Validate recipes
|
||||
run: |
|
||||
cd bib
|
||||
for recipe in ../recipes/*.yml; do
|
||||
echo "Validating $recipe..."
|
||||
./particle-os validate "$recipe"
|
||||
done
|
||||
|
||||
# Build and test with real container extraction
|
||||
integration-test:
|
||||
name: Integration Test
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-utils podman
|
||||
|
||||
- name: Build particle-os
|
||||
run: |
|
||||
cd bib
|
||||
go build -o particle-os cmd/particle_os/main.go
|
||||
|
||||
- name: Test container extraction
|
||||
run: |
|
||||
cd bib
|
||||
# Test container inspection
|
||||
./particle-os container debian:trixie-slim
|
||||
|
||||
- name: Test minimal build (if time allows)
|
||||
run: |
|
||||
cd bib
|
||||
# Only run if we have time (CI time limits)
|
||||
timeout 300 sudo ./particle-os build ../recipes/debian-minimal.yml || echo "Build timed out (expected in CI)"
|
||||
|
||||
# Build and release
|
||||
build:
|
||||
name: Build and Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test, integration-test]
|
||||
if: github.event_name == 'release'
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: Build particle-os
|
||||
run: |
|
||||
cd bib
|
||||
go build -ldflags="-s -w" -o particle-os cmd/particle_os/main.go
|
||||
|
||||
- name: Create release artifacts
|
||||
run: |
|
||||
mkdir -p release
|
||||
cd bib
|
||||
tar -czf ../release/particle-os-linux-amd64.tar.gz particle-os
|
||||
cd ..
|
||||
|
||||
# Create checksums
|
||||
cd release
|
||||
sha256sum particle-os-linux-amd64.tar.gz > particle-os-linux-amd64.tar.gz.sha256
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: particle-os-release
|
||||
path: release/
|
||||
|
||||
- name: Create GitHub release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: release/*
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: particle-os ${{ github.ref_name }}
|
||||
body: |
|
||||
## particle-os ${{ github.ref_name }}
|
||||
|
||||
Debian-native OS image builder with real system operations.
|
||||
|
||||
### What's New
|
||||
- Production-ready OS building system
|
||||
- Real container extraction and processing
|
||||
- Real package management and system configuration
|
||||
- Real QEMU image creation in multiple formats
|
||||
|
||||
### Downloads
|
||||
- Linux AMD64: `particle-os-linux-amd64.tar.gz`
|
||||
|
||||
### Quick Start
|
||||
```bash
|
||||
tar -xzf particle-os-linux-amd64.tar.gz
|
||||
sudo ./particle-os build recipes/debian-test.yml
|
||||
```
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Security and quality checks
|
||||
security:
|
||||
name: Security & Quality
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
|
||||
- name: Run Go security checks
|
||||
run: |
|
||||
cd bib
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
govulncheck ./...
|
||||
|
||||
- name: Run Go linting
|
||||
run: |
|
||||
cd bib
|
||||
go install golang.org/x/lint/golint@latest
|
||||
golint ./...
|
||||
|
||||
- name: Check Go formatting
|
||||
run: |
|
||||
cd bib
|
||||
if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then
|
||||
echo "Code is not formatted. Run 'gofmt -w .'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check Go mod tidy
|
||||
run: |
|
||||
cd bib
|
||||
go mod tidy
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "go.mod or go.sum needs updating"
|
||||
exit 1
|
||||
fi
|
||||
52
.github/workflows/particle-os-build.yml
vendored
Normal file
52
.github/workflows/particle-os-build.yml
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
name: Test particle-os Basic Functionality
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
paths:
|
||||
- 'recipes/**'
|
||||
- 'bib/**'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-basic:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y curl qemu-utils
|
||||
|
||||
- name: Build particle-os
|
||||
run: |
|
||||
cd bib
|
||||
go build -o particle-os cmd/particle_os/main.go
|
||||
|
||||
- name: Test recipe validation
|
||||
run: |
|
||||
cd bib
|
||||
./particle-os validate ../recipes/minimal-test.yml
|
||||
./particle-os validate ../recipes/simple-server.yml
|
||||
|
||||
- name: Test CLI help
|
||||
run: |
|
||||
cd bib
|
||||
./particle-os --help
|
||||
./particle-os list
|
||||
./particle-os version
|
||||
|
||||
- name: Test container inspection
|
||||
run: |
|
||||
cd bib
|
||||
./particle-os container debian:trixie-slim
|
||||
74
.github/workflows/test-cicd.yml
vendored
Normal file
74
.github/workflows/test-cicd.yml
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
name: Test particle-os CI/CD
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual trigger
|
||||
|
||||
jobs:
|
||||
test-cicd:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.21'
|
||||
|
||||
- name: Build particle-os
|
||||
run: |
|
||||
cd bib
|
||||
go build -o particle-os cmd/particle_os/main.go
|
||||
cd ..
|
||||
|
||||
- name: Test CI/CD mode
|
||||
run: |
|
||||
# Test quiet mode (should show minimal output)
|
||||
echo "Testing quiet mode..."
|
||||
if sudo ./bib/particle-os build --json --quiet --clean recipes/debian-test.yml 2>&1 | grep -q "INFO"; then
|
||||
echo "❌ FAIL: Quiet mode still shows INFO logs"
|
||||
exit 1
|
||||
else
|
||||
echo "✅ PASS: Quiet mode suppresses INFO logs"
|
||||
fi
|
||||
|
||||
- name: Test JSON output
|
||||
run: |
|
||||
echo "Testing JSON output..."
|
||||
BUILD_OUTPUT=$(sudo ./bib/particle-os build --json --quiet --clean recipes/debian-test.yml 2>&1 | grep -A 20 '^{' | head -n 20)
|
||||
|
||||
# Check if output contains JSON
|
||||
if echo "$BUILD_OUTPUT" | grep -q '{'; then
|
||||
echo "✅ PASS: Output contains JSON"
|
||||
|
||||
# Check for required fields
|
||||
REQUIRED_FIELDS=("recipe" "base_image" "stages" "output_formats" "image_path" "work_directory" "build_time" "exit_code")
|
||||
for field in "${REQUIRED_FIELDS[@]}"; do
|
||||
if echo "$BUILD_OUTPUT" | grep -q "\"$field\""; then
|
||||
echo "✅ PASS: JSON contains $field field"
|
||||
else
|
||||
echo "❌ FAIL: JSON missing $field field"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
else
|
||||
echo "❌ FAIL: Output is not JSON format"
|
||||
echo "Output: $BUILD_OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Test exit codes
|
||||
run: |
|
||||
echo "Testing exit codes..."
|
||||
if sudo ./bib/particle-os build --json --quiet --clean recipes/debian-test.yml > /dev/null 2>&1; then
|
||||
echo "✅ PASS: Build command returns appropriate exit code"
|
||||
else
|
||||
echo "❌ FAIL: Build command failed unexpectedly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Success
|
||||
run: |
|
||||
echo "🎉 All CI/CD tests passed!"
|
||||
echo "particle-os is ready for production CI/CD use!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue