Skip to content

CI/CD

CI/CD #3

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
nacos:
image: nacos/nacos-server:v2.2.3
env:
MODE: standalone
PREFER_HOST_MODE: hostname
ports:
- 8848:8848
- 9848:9848
options: >-
--health-cmd="curl -f http://localhost:8848/nacos/v1/console/health/readiness"
--health-interval=10s
--health-timeout=5s
--health-retries=12
--health-start-period=40s
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Run unit tests
run: mvn test -pl rpc-core,rpc-transport-netty
- name: Run integration tests
run: mvn test -pl rpc-consumer -am -Dtest=FullIntegrationTest
env:
RPC_REGISTRY: local
- name: Check test coverage
run: mvn jacoco:report
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
**/target/surefire-reports/
**/target/site/jacoco/
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- name: Run Maven verify
run: mvn verify -DskipTests
- name: Check code style
run: mvn checkstyle:check || true