Skip to content

Use codecov v4

Use codecov v4 #479

Workflow file for this run

name: Build
on:
push:
branches: [main]
pull_request:
branches: ["**"]
workflow_call: {}
workflow_dispatch: {}
jobs:
build-x86_64-crossos:
name: jdk-${{ matrix.java-version }}/${{ matrix.os-name }}/x86_64
runs-on: ${{ matrix.os-name }}
strategy:
fail-fast: false
matrix:
os-name: [ubuntu-latest, macos-latest, windows-latest]
java-version: [11, 21]
steps:
- name: Checkout code
uses: actions/checkout@v4
# Install protoc onto the PATH so that we can test PATH resolution.
- name: Install dependencies
shell: bash
run: |-
set -eux
case "${{ matrix.os-name }}" in
# TODO: uncomment once protoc 4.26.0 is used globally.
#macos-*) brew install protobuf ;;
ubuntu-*) sudo apt -q update && sudo apt -qy install protobuf-compiler ;;
# TODO: uncomment once protoc 4.26.0 is used globally.
#windows-*) choco install protoc ;;
esac
java -version
javac -version
protoc --version || true
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Build and test
shell: bash
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v3
continue-on-error: true
if: always()
build-x86_64-oldmaven:
name: mvn 3.8.1 jdk-11/ubuntu-latest/x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
cache: maven
- name: Change Maven version to the prerequisite version
shell: bash
run: |-
version=$(./mvnw help:evaluate -q \
-Dexpression='project.prerequisites.maven' \
-DforceStdout)
./mvnw wrapper:wrapper -Dmaven="${version}"
- name: Build and test
shell: bash
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v3
continue-on-error: true
if: always()
build-crossarch-ubuntu:
name: jdk-11/ubuntu-latest/${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [aarch64, ppc64le, s390x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build in emulator
uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
distro: ubuntu_latest
# Mount /target so that we can pull the coverage results
dockerRunArgs: '--volume "${PWD}/target:/home/runner/work/target"'
install: |-
set -eux
apt update -q
apt install -qy openjdk-11-jdk-headless protobuf-compiler
java -version
javac -version
protoc --version
run: ./mvnw -B verify
- name: Publish code coverage
uses: codecov/codecov-action@v4
continue-on-error: true
if: always()
with:
token: ${{ secrets.CODECOV_TOKEN }}