You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MyClipboard/.github/workflows/build.yml

67 lines
1.8 KiB
YAML

name: Build
on:
push:
branches: '**'
paths:
- 'src/**'
- 'pom.xml'
pull_request:
branches: '**'
paths:
- 'src/**'
- 'pom.xml'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Build
run: mvn -B -DskipTests clean package
- name: Test
uses: GabrielBB/xvfb-action@v1
with:
run: mvn test
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./target/site/jacoco
files: jacoco.xml
fail_ci_if_error: false
- name: Retrieve Name & Version
run: |
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
echo "NAME=$(mvn help:evaluate -Dexpression=project.name -q -DforceStdout)" >> $GITHUB_ENV
- name: Archive Jar
uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}-${{ env.VERSION }}.jar
path: ./target/${{ env.NAME }}-${{ env.VERSION }}.jar
- name: Archive Javadoc
uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}-${{ env.VERSION }}-javadoc.jar
path: ./target/${{ env.NAME }}-${{ env.VERSION }}-javadoc.jar
- name: Archive Sources
uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}-${{ env.VERSION }}-sources.jar
path: ./target/${{ env.NAME }}-${{ env.VERSION }}-sources.jar