docs: add CI pipeline for automated build and test, including spotless #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | ||
| on: | ||
| push: | ||
| branches: | ||
| - ["main"] | ||
| pull_request: | ||
| branches: | ||
| - ["main"] | ||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Checks out code from GitHub | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| # Sets up Java 25 (Temurin) and cache Maven-dependencies | ||
| - name: Set up JDK 25 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| java-version: '25' | ||
| distribution: 'temurin' | ||
| cache: 'maven' | ||
| # Make sure Maven Wrapper is executable | ||
| - name: Make mvnm executable | ||
| run: chmod +x mvnw | ||
| # Compile and run tests | ||
| - name: Compile and run tests | ||
| run: ./mvnw -B tests | ||
| # Control code format with spotless | ||
| - name: Run spotless check | ||
| run: ./mvnw -B spotless:check | ||