Actual working m2e metadata file (#686) #2054
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 | |
on: | |
pull_request: | |
branches: [main, "v*"] | |
push: | |
branches: [main, "v*"] | |
schedule: | |
# Run every week on a Sunday. The time we run at (3:43am) is | |
# arbitrary, in the spirit of not contributing to the flood of | |
# GitHub builds that will occur at midnight/on the hour/on the | |
# half hour. | |
- cron: "43 3 * * 6" | |
workflow_dispatch: {} | |
jobs: | |
validate: | |
name: Validate | |
runs-on: ubuntu-latest | |
outputs: | |
default_maven_version: ${{ steps.determine_default_maven_version.outputs.default_maven_version }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize Java | |
uses: actions/setup-java@v4 | |
with: | |
cache: maven | |
distribution: temurin | |
java-version: 24 | |
- name: Validate shell scripts | |
uses: ludeeus/action-shellcheck@master | |
if: always() | |
with: | |
check_together: 'yes' | |
scandir: ./scripts | |
- name: Validate codecov.yml | |
shell: bash | |
if: always() | |
run: curl -vvv --fail --data-binary @- https://codecov.io/validate < codecov.yml | |
- name: Validate license headers and code style | |
shell: bash | |
if: always() | |
run: ./mvnw -B validate | |
- name: Determine default Maven version | |
id: determine_default_maven_version | |
shell: bash | |
if: always() | |
run: |- | |
maven_version=$(./mvnw help:evaluate -Dexpression=maven.version -DforceStdout=true --quiet) | |
echo "Maven Version: ${maven_version}" | |
echo "default_maven_version=${maven_version}" >> "${GITHUB_OUTPUT}" | |
build: | |
name: mvn ${{ matrix.maven-version }}/java ${{ matrix.java-version }}/${{ matrix.os-name }} | |
runs-on: ${{ matrix.os-name }} | |
timeout-minutes: 30 | |
needs: | |
- validate | |
strategy: | |
fail-fast: false | |
matrix: | |
os-name: [ubuntu-latest] | |
java-version: [11, 17, 21, 24] | |
maven-version: ["${{ needs.validate.outputs.default_maven_version }}"] | |
include: | |
- os-name: macos-latest | |
java-version: 11 | |
maven-version: "${{ needs.validate.outputs.default_maven_version }}" | |
- os-name: windows-latest | |
java-version: 11 | |
maven-version: "${{ needs.validate.outputs.default_maven_version }}" | |
- os-name: ubuntu-latest | |
java-version: 11 | |
maven-version: 3.8.8 | |
- os-name: ubuntu-latest | |
java-version: 17 | |
maven-version: 4.0.0-rc-3 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize Java | |
uses: actions/setup-java@v4 | |
with: | |
cache: maven | |
java-version: ${{ matrix.java-version }} | |
distribution: 'temurin' | |
- name: Set Maven version to ${{ matrix.maven-version }} | |
shell: bash | |
run: |- | |
./mvnw -B -T1 -q wrapper:wrapper "-Dmaven=${{ matrix.maven-version }}" | |
./mvnw --version | |
- name: Install Protoc to $PATH | |
shell: bash | |
run: scripts/install-protoc-to-github-runner.sh | |
- name: Build and test | |
shell: bash | |
run: ./mvnw -B -Dcheckstyle.skip -Dlicense.skip clean verify | |
- name: Publish code coverage | |
uses: codecov/codecov-action@v4 | |
continue-on-error: true | |
if: always() | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Upload build logs as artifacts | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: jdk-${{ matrix.java-version }}-${{ matrix.os-name }}-${{ matrix.maven-version }} | |
path: |- | |
**/build.log | |
**/maven-status/** | |
**/surefire-reports/**.txt | |
compression-level: 9 | |
retention-days: 7 | |
include-hidden-files: true | |
if-no-files-found: warn | |
documentation: | |
name: Documentation | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: | |
- validate | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize Java | |
uses: actions/setup-java@v4 | |
with: | |
cache: maven | |
distribution: temurin | |
java-version: 24 | |
- name: Build site | |
shell: bash | |
run: |- | |
./mvnw -B site \ | |
-Dmaven.test.skip \ | |
-Dinvoker.skip \ | |
-Dcheckstyle.skip \ | |
-Dlicense.skip | |
- name: Upload generated site as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: site | |
path: protobuf-maven-plugin/target/site/** | |
compression-level: 9 | |
retention-days: 7 | |
include-hidden-files: true | |
if-no-files-found: error | |
notify-coverage: | |
name: Notify of coverage | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
needs: | |
- build | |
- documentation | |
- validate | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Publish code coverage | |
uses: codecov/codecov-action@v5 | |
continue-on-error: true | |
if: always() | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
run_command: send-notifications |