113 lines
2.4 KiB
YAML
113 lines
2.4 KiB
YAML
name: Veza CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "remediation/*" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
backend-go:
|
|
name: Backend (Go)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.21'
|
|
cache: true
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd veza-backend-api
|
|
go mod download
|
|
|
|
- name: Vet
|
|
run: |
|
|
cd veza-backend-api
|
|
go vet ./...
|
|
|
|
- name: Test
|
|
run: |
|
|
cd veza-backend-api
|
|
# Running tests excluding those that require DB connection for now
|
|
go test -v ./internal/handlers/... ./internal/services/... -short
|
|
|
|
- name: Build
|
|
run: |
|
|
cd veza-backend-api
|
|
go build -v ./...
|
|
|
|
rust-services:
|
|
name: Rust Services (Chat & Stream)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Check Formatting
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: Build Chat Server
|
|
run: |
|
|
cd veza-chat-server
|
|
cargo check
|
|
cargo build --verbose
|
|
|
|
- name: Build Stream Server (Allow Failure)
|
|
# Allowed to fail because SQLx offline data might be missing
|
|
continue-on-error: true
|
|
run: |
|
|
cd veza-stream-server
|
|
cargo check
|
|
|
|
- name: Test Chat Server
|
|
run: |
|
|
cd veza-chat-server
|
|
cargo test --verbose
|
|
|
|
frontend:
|
|
name: Frontend (Web)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
cache: 'npm'
|
|
cache-dependency-path: apps/web/package-lock.json
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
cd apps/web
|
|
npm ci
|
|
|
|
- name: Type Check
|
|
run: |
|
|
cd apps/web
|
|
npm run type-check --if-present
|
|
|
|
- name: Build
|
|
run: |
|
|
cd apps/web
|
|
npm run build --if-present
|