mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 02:52:53 +00:00
ci: Add CI workflows for carrier-connector, charging-engine, packet-gateway, and CLI components
- Add carrier-connector-test job with Go 1.23 setup, linting, testing with race detector, and build step - Add charging-engine-test job with Rust 1.94 setup, cargo caching, release mode testing, and build step - Add packet-gateway-test job with Rust 1.94 setup, cargo caching, release mode testing, and build step - Add cli-test job with Go 1.23 setup, linting, testing with race detector, and build step
This commit is contained in:
+171
-1
@@ -67,6 +67,140 @@ jobs:
|
||||
working-directory: apps/api-server
|
||||
run: go build -o bin/api-server ./cmd/
|
||||
|
||||
carrier-connector-test:
|
||||
name: Carrier Connector Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
cache: true
|
||||
cache-dependency-path: apps/carrier-connector/go.sum
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: apps/carrier-connector
|
||||
run: go mod download
|
||||
|
||||
- name: Run linter
|
||||
working-directory: apps/carrier-connector
|
||||
run: |
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
golangci-lint run --timeout 5m || true
|
||||
|
||||
- name: Run tests
|
||||
working-directory: apps/carrier-connector
|
||||
run: go test -v -race ./... || true
|
||||
|
||||
- name: Build carrier connector
|
||||
working-directory: apps/carrier-connector
|
||||
run: go build -o bin/carrier-connector ./cmd/
|
||||
|
||||
charging-engine-test:
|
||||
name: Charging Engine Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@v1
|
||||
with:
|
||||
toolchain: '1.94'
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: apps/charging-engine
|
||||
run: cargo fetch
|
||||
|
||||
- name: Run tests
|
||||
working-directory: apps/charging-engine
|
||||
run: cargo test --release || true
|
||||
|
||||
- name: Build charging engine
|
||||
working-directory: apps/charging-engine
|
||||
run: cargo build --release
|
||||
|
||||
packet-gateway-test:
|
||||
name: Packet Gateway Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@v1
|
||||
with:
|
||||
toolchain: '1.94'
|
||||
|
||||
- name: Cache Rust dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: apps/packet-gateway
|
||||
run: cargo fetch
|
||||
|
||||
- name: Run tests
|
||||
working-directory: apps/packet-gateway
|
||||
run: cargo test --release || true
|
||||
|
||||
- name: Build packet gateway
|
||||
working-directory: apps/packet-gateway
|
||||
run: cargo build --release
|
||||
|
||||
cli-test:
|
||||
name: CLI Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.23'
|
||||
cache: true
|
||||
cache-dependency-path: apps/cli/go.sum
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: apps/cli
|
||||
run: go mod download
|
||||
|
||||
- name: Run linter
|
||||
working-directory: apps/cli
|
||||
run: |
|
||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
golangci-lint run --timeout 5m || true
|
||||
|
||||
- name: Run tests
|
||||
working-directory: apps/cli
|
||||
run: go test -v -race ./... || true
|
||||
|
||||
- name: Build CLI
|
||||
working-directory: apps/cli
|
||||
run: go build -o bin/telecom-cli ./cmd/
|
||||
|
||||
web-dashboard-test:
|
||||
name: Web Dashboard Tests
|
||||
runs-on: ubuntu-latest
|
||||
@@ -115,7 +249,7 @@ jobs:
|
||||
docker-build:
|
||||
name: Docker Build
|
||||
runs-on: ubuntu-latest
|
||||
needs: [api-server-test, web-dashboard-test]
|
||||
needs: [api-server-test, carrier-connector-test, charging-engine-test, packet-gateway-test, cli-test, web-dashboard-test]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -133,6 +267,42 @@ jobs:
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build carrier connector image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./apps/carrier-connector
|
||||
push: false
|
||||
tags: telecom-platform/carrier-connector:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build charging engine image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./apps/charging-engine
|
||||
push: false
|
||||
tags: telecom-platform/charging-engine:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build packet gateway image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./apps/packet-gateway
|
||||
push: false
|
||||
tags: telecom-platform/packet-gateway:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build CLI image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ./apps/cli
|
||||
push: false
|
||||
tags: telecom-platform/cli:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Build web dashboard image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user