Skip to content

Feature/separate coveralls job #93

Feature/separate coveralls job

Feature/separate coveralls job #93

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches:
- main
- 'feature/**'
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
uses: GabrielBB/xvfb-action@v1
with:
run: mvn -B -P jacoco test --file pom.xml
- uses: actions/upload-artifact@master
with:
name: target
path: '**/target/**'
retention-days: 1
- name: Clear Caches
run: curl -X PURGE https://camo.githubusercontent.com/12360894f9884ce231cc60af14c148a20f0e1690f05047e503a37c69c8eab868/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c696e6b2d696e74657273797374656d732f636c65616e2d6172636869746563747572652d6578616d706c652f62616467652e7376673f6272616e63683d6d61696e
coveralls:
needs: build
if: ${{ (github.repository == 'link-intersystems/clean-architecture-example') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: target
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: mvn -B coveralls:report --file pom.xml
publish:
needs: build
if: ${{ (github.repository == 'link-intersystems/clean-architecture-example') && startsWith(github.ref, 'refs/heads/main') }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: GabrielBB/xvfb-action@v1
with:
run: mvn -B -P github -Dmaven.test.skip=true -T 1C deploy --file pom.xml