fix: testing release-please (#21) #7
This file contains 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
# | |
# Copyright (c) 2021-2023 - for information on the respective copyright owner | |
# see the NOTICE file and/or the repository https://github.com/carbynestack/java-http-client. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
name: Build and test artifacts | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
prepare: | |
runs-on: ubuntu-22.04 | |
outputs: | |
matrix: ${{ steps.jdk.outputs.matrix }} | |
steps: | |
- name: Split JDK identifier | |
id: jdk | |
run: echo "::set-output name=matrix::{\"jdk\":[{\"distribution\":\"temurin\",\"version\":8},{\"distribution\":\"temurin\",\"version\":17}]}" | |
build: | |
runs-on: ubuntu-22.04 | |
needs: prepare | |
strategy: | |
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ matrix.jdk.version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.jdk.version }} | |
distribution: ${{ matrix.jdk.distribution }} | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn install -Dskip.tests --batch-mode --update-snapshots --no-transfer-progress | |
test: | |
runs-on: ubuntu-22.04 | |
needs: prepare | |
strategy: | |
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK ${{ matrix.jdk.version }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.jdk.version }} | |
distribution: ${{ matrix.jdk.distribution }} | |
cache: 'maven' | |
- name: Run Tests | |
run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress | |
- name: Collect Jacoco reports | |
if: matrix.jdk.version == 8 | |
run: echo ::set-output name=reports::$(find . -regex '.*/target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//') | |
id: jacoco | |
- uses: codecov/codecov-action@v2 | |
if: matrix.jdk.version == 8 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{ steps.jacoco.outputs.reports }} | |
name: codecov |