Skip to content

Fix dependency security audit failures #309

Fix dependency security audit failures

Fix dependency security audit failures #309

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
# Overall tests and validation
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate version consistency
run: make validate-version
# Unit Tests - Fast feedback on code quality
unit-tests:
runs-on: ubuntu-latest
needs: [validate]
strategy:
fail-fast: false
matrix:
service:
- name: java
path: java/server
setup: java
test_cmd: mvn test
- name: java-auth-server
path: java-auth/server
setup: java
test_cmd: mvn test
- name: java-auth-client
path: java-auth/client
setup: java
test_cmd: mvn test
- name: ruby-api
path: ruby-api
setup: ruby
test_cmd: ./test-unit.sh
- name: csharp
path: csharp
setup: dotnet
test_cmd: dotnet test
- name: llm-simulation-tools
path: llm-simulation-demo/tools-service
setup: python
test_cmd: make test
- name: llm-simulation-backend
path: llm-simulation-demo/backend
setup: python
test_cmd: make test
- name: llm-simulation-frontend
path: llm-simulation-demo/frontend
setup: node
test_cmd: make test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Code Env
if: matrix.service.setup == 'java'
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Code Env
if: matrix.service.setup == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: ${{ matrix.service.path }}
- name: Set up Code Env
if: matrix.service.setup == 'dotnet'
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Set up Code Env
if: matrix.service.setup == 'python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Code Env
if: matrix.service.setup == 'node'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache Dependencies
if: matrix.service.setup == 'java'
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run Tests
working-directory: ${{ matrix.service.path }}
env:
SPEEDSCALE_API_KEY: ${{ secrets.SPEEDSCALE_API_KEY }}
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: tasks_db
DB_USER: postgres
DB_PASSWORD: postgres
JWT_SECRET: test-secret-for-ci
USE_MOCK_SERVER: 'true'
run: ${{ matrix.service.test_cmd }}
- name: Upload Results
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-${{ matrix.service.name }}-results
path: |
${{ matrix.service.path }}/target/surefire-reports/
${{ matrix.service.path }}/**/*.log
retention-days: 7
# Integration Tests - Functional correctness with proxymock
integration-tests:
runs-on: ubuntu-latest
needs: [validate]
strategy:
fail-fast: false
matrix:
service:
- name: ruby-api
path: ruby-api
setup: ruby
test_cmd: ./test-integration.sh
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Code Env
if: matrix.service.setup == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: ${{ matrix.service.path }}
- name: Run Tests
working-directory: ${{ matrix.service.path }}
env:
SPEEDSCALE_API_KEY: ${{ secrets.SPEEDSCALE_API_KEY }}
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: tasks_db
DB_USER: postgres
DB_PASSWORD: postgres
JWT_SECRET: test-secret-for-ci
USE_MOCK_SERVER: 'true'
run: ${{ matrix.service.test_cmd }}
- name: Upload Results
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-${{ matrix.service.name }}-results
path: |
${{ matrix.service.path }}/proxymock/replayed-*
${{ matrix.service.path }}/**/*.log
retention-days: 7
# Load Tests - Performance validation under load
load-tests:
runs-on: ubuntu-latest
needs: [validate]
strategy:
fail-fast: false
matrix:
service:
- name: ruby-api
path: ruby-api
setup: ruby
test_cmd: ./test-load.sh
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Code Env
if: matrix.service.setup == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: ${{ matrix.service.path }}
- name: Run Tests
working-directory: ${{ matrix.service.path }}
env:
SPEEDSCALE_API_KEY: ${{ secrets.SPEEDSCALE_API_KEY }}
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: tasks_db
DB_USER: postgres
DB_PASSWORD: postgres
JWT_SECRET: test-secret-for-ci
USE_MOCK_SERVER: 'true'
run: ${{ matrix.service.test_cmd }}
- name: Upload Results
if: always()
uses: actions/upload-artifact@v4
with:
name: load-${{ matrix.service.name }}-results
path: |
${{ matrix.service.path }}/proxymock/replayed-*
${{ matrix.service.path }}/**/*.log
retention-days: 7
# Build matrix for different services
build:
runs-on: ubuntu-latest
needs: [unit-tests, integration-tests, load-tests]
strategy:
fail-fast: false
matrix:
service:
- name: java
path: java
build_cmd: make build
- name: java-auth
path: java-auth
build_cmd: make build
- name: node
path: node
build_cmd: make build
- name: smart-replace-demo
path: smart-replace-demo
build_cmd: make build
- name: ruby-api
path: ruby-api
build_cmd: make build
- name: ruby-client
path: ruby-api
build_cmd: make build-client
- name: csharp
path: csharp
build_cmd: make build
- name: llm-simulation-frontend
path: llm-simulation-demo/frontend
build_cmd: make build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Code Env
if: contains(matrix.service.name, 'java')
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Code Env
if: contains(matrix.service.name, 'node') || matrix.service.name == 'smart-replace-demo' || matrix.service.name == 'llm-simulation-frontend'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up Code Env
if: contains(matrix.service.name, 'ruby')
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
working-directory: ${{ matrix.service.path }}
- name: Set up Code Env
if: contains(matrix.service.name, 'csharp')
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache Dependencies
if: contains(matrix.service.name, 'java')
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build Service
working-directory: ${{ matrix.service.path }}
run: ${{ matrix.service.build_cmd }}
- name: Upload Results
if: always() && contains(matrix.service.name, 'java')
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.service.name }}-artifacts
path: |
${{ matrix.service.path }}/**/target/*.jar
retention-days: 30
# Docker build and push (only on master branch)
docker:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
include:
- service: java
path: java
target: docker-multi
- service: node
path: node
target: docker-multi
- service: java-auth
path: java-auth
target: docker-multi
- service: smart-replace-demo
path: smart-replace-demo
target: docker-multi
- service: ruby-api
path: ruby-api
target: docker-multi
- service: ruby-client
path: ruby-api
target: docker-client
- service: csharp
path: csharp
target: docker-multi
- service: csharp-client
path: csharp
target: docker-client-multi
- service: php
path: php
target: docker-multi
- service: gateway
path: scenarios/microservices/gateway
target: docker-multi
- service: llm-simulation-tools
path: llm-simulation-demo/tools-service
target: docker-multi
- service: llm-simulation-backend
path: llm-simulation-demo/backend
target: docker-multi
- service: llm-simulation-frontend
path: llm-simulation-demo/frontend
target: docker-multi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Configure Docker for GCR
run: gcloud auth configure-docker
- name: Get version
id: version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Build and push Docker image
working-directory: ${{ matrix.path }}
run: make ${{ matrix.target }} VERSION=${{ steps.version.outputs.version }}