diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b534d3b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: Order Contract CI + +on: + pull_request: + push: + branches: [main, master, feature/spring-microservices, chore/registry-ci] + +permissions: + contents: read + security-events: write + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' + cache: maven + - run: ./mvnw --batch-mode validate + + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + git diff --check + ! grep -R -n -E '^(<<<<<<<|=======|>>>>>>>)' --exclude-dir=.git . + + test: + runs-on: ubuntu-latest + needs: [lint, format] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' + cache: maven + - run: ./mvnw --batch-mode --no-transfer-progress test + + quality: + runs-on: ubuntu-latest + needs: test + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '25' + cache: maven + - run: ./mvnw --batch-mode --no-transfer-progress verify + + security: + runs-on: ubuntu-latest + needs: lint + steps: + - uses: actions/checkout@v4 + - uses: github/codeql-action/init@v3 + with: + languages: java + - uses: github/codeql-action/autobuild@v3 + - uses: github/codeql-action/analyze@v3 diff --git a/README.md b/README.md index b2373a5..34e2cf6 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,7 @@ response records and the controller interface consumed by This contract has no runtime configuration and requires no GitHub Actions secrets. + +The contract workflow validates formatting, Maven compilation, tests, quality, +and CodeQL. It does not publish a container because it is a reusable Java +library rather than a runnable service.