Skip to content

first commit

first commit #1

Workflow file for this run

# CI workflow for ans-sdk-java
# Runs build, tests, and checkstyle on pushes/PRs to main.
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
checks: write
jobs:
# Build all modules, run tests, and checkstyle validation.
# Enforces a minimum 90% coverage threshold.
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4
with:
java-version: '17'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@0b6dd653ba04f4f93bf581ec31e66cbd7dcb644d # v4
- name: Cache Gradle packages
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew build
- name: Check coverage threshold
run: ./gradlew jacocoTestCoverageVerification
- name: Publish unit test report
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # v5
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
check_name: 'Unit Test Report'
- name: Upload coverage reports
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: coverage-reports
path: '**/build/reports/jacoco/test/jacocoTestReport.xml'
retention-days: 30