This repository's default branch is main, but every workflow was still keyed to master, so none of them could ever run: - build-and-test.yml triggered on push/PR to master, so CI never fired and the README's build badge had no status to report. - docker-publish.yml keyed off a successful build-and-test run on master, so it never fired either. Only trigger filters and comments referenced the branch; the tag-vs-branch logic was already branch-agnostic. - make-release.yml actively refused to run, failing with "Regular releases can only be created from the 'master' branch." Also updated the branch names throughout docs/DEVELOPMENT_WORKFLOW.md to match.
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: Build and Test
|
|
|
|
# Build and test on PRs and main pushes
|
|
# This workflow does NOT publish Docker images - that's handled by docker-publish.yml
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main # PRs targeting trunk
|
|
push:
|
|
branches:
|
|
- main # Direct pushes to main
|
|
paths-ignore:
|
|
- '.github/**' # Ignore GitHub config changes (workflows, actions, templates, etc.)
|
|
- 'README.md'
|
|
- 'LICENSE'
|
|
- 'CNAME'
|
|
- 'docs/**'
|
|
- '*.example.yml'
|
|
- '*.example.yaml'
|
|
- '.circleci/**' # If not using CircleCI, ignore its config
|
|
|
|
# Cancel in-progress runs for the same workflow and branch
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and Test
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
permissions:
|
|
contents: read # Only need to checkout repository
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Java Environment
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '25'
|
|
distribution: 'temurin'
|
|
cache: maven
|
|
|
|
- name: Build and Test with Coverage
|
|
run: |
|
|
COMMIT_TIME=$(git log -1 --format=%cI)
|
|
mvn --batch-mode verify -Pcoverage -Dproject.build.outputTimestamp=$COMMIT_TIME
|
|
|
|
- name: Upload Coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
report_type: coverage
|
|
files: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
fail_ci_if_error: false
|
|
|
|
- name: Upload test results to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
report_type: test_results
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|