Skip to content

Merge pull request #30 from poyrazK/feat/content-unpublish-workflow #76

Merge pull request #30 from poyrazK/feat/content-unpublish-workflow

Merge pull request #30 from poyrazK/feat/content-unpublish-workflow #76

Workflow file for this run

name: CI
permissions:
contents: read
pull-requests: read
on:
pull_request:
push:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
java: ${{ steps.filter.outputs.java }}
identity: ${{ steps.filter.outputs.identity }}
go: ${{ steps.filter.outputs.go }}
ci: ${{ steps.filter.outputs.ci }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect changed paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
docs:
- '**/*.md'
- 'docs/**'
- 'scripts/ci/**'
- '.markdownlint.json'
java:
- 'services/java/**'
identity:
- 'services/java/identity-service/**'
- 'services/java/pom.xml'
go:
- '**/*.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
ci:
- '.github/workflows/ci.yml'
docs-and-contracts:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.docs == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Markdown lint
uses: DavidAnson/markdownlint-cli2-action@v17
with:
globs: "**/*.md"
- name: Validate required contract files
run: bash scripts/ci/check-contract-files.sh
java-quality:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.java == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Java validation
run: |
if [ -f services/java/pom.xml ]; then
mvn -B -q -f services/java/pom.xml -DskipTests validate
else
echo "Java parent module not present; skipping validation."
fi
- name: Java lint (spotless + checkstyle)
run: |
if [ -f services/java/pom.xml ]; then
mvn -B -q -f services/java/pom.xml spotless:check checkstyle:check
else
echo "Java parent module not present; skipping lint."
fi
java-tests-identity:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.identity == 'true' || needs.changes.outputs.java == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
cache: maven
- name: Identity service tests and coverage check
run: |
if [ -f services/java/identity-service/pom.xml ]; then
mvn -B -q -f services/java/pom.xml -pl identity-service -am verify
else
echo "Identity service not scaffolded yet; skipping tests."
fi
- name: Upload identity test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: identity-surefire-reports
path: services/java/identity-service/target/surefire-reports/**
if-no-files-found: ignore
- name: Upload identity coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: identity-jacoco-report
path: services/java/identity-service/target/site/jacoco/**
if-no-files-found: ignore
go-quality:
needs: changes
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Go test
run: |
if [ -f go.mod ]; then
go test ./...
else
echo "No Go module yet; skipping Go validation."
fi
- name: Go lint (golangci-lint)
if: ${{ hashFiles('**/go.mod') != '' }}
uses: golangci/golangci-lint-action@v6
with:
version: v1.60