Bump actions/upload-artifact from 3 to 4 #1271
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
name: build | |
on: | |
push: | |
paths-ignore: | |
- '*.md' | |
- 'images/**' | |
pull_request: | |
paths-ignore: | |
- '*.md' | |
- 'images/**' | |
jobs: | |
build-maven: | |
name: Builds and tests for Maven under Batect | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@master | |
- name: Restore Batect caches | |
uses: actions/cache@master | |
env: | |
cache-name: batect-cache | |
with: | |
path: ~/.batect | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/batect.xml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Restore Maven caches | |
uses: actions/cache@master | |
env: | |
cache-name: maven-cache | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build and test with Maven under Batect | |
run: ./batect build | |
- name: Generate coverage badge | |
# if: ${{ github.ref == 'refs/head/master' }} | |
uses: cicirello/jacoco-badge-generator@v2 | |
with: | |
badges-directory: images | |
generate-branches-badge: false | |
generate-summary: false | |
- name: Save coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: target/site/jacoco | |
- name: Add coverage to repo | |
# if: ${{ github.ref == 'refs/head/master' }} | |
run: | | |
cd images | |
if [[ ! -z "$(git status --porcelain *.svg)" ]]; then | |
git config --global user.name 'github-actions' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add *.svg | |
git commit -m 'Autogenerated coverage badge' | |
git push || echo "$0: Another build won for coverage badge" >&2 | |
fi | |
- name: Execute run script | |
run: ./batect -o quiet demo | |
- name: Execute run script for Java | |
run: ./batect -o quiet java-demo |