Gernics only. #301
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 | |
# description: Builds, tests and publishes artifacts to sonatype snapshots | |
on: | |
push: | |
branches: | |
- 'main' | |
- '**-SNAPSHOT' | |
paths-ignore: | |
- 'README.adoc' | |
- 'docs/**' | |
- '.github/workflows/publish-documentation.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | |
steps: | |
- name: Cancel previous Action | |
uses: styfle/[email protected] | |
- uses: actions/checkout@v3 | |
with: | |
# Use personal token for the commit at the end. otherwise publish-documentation action is not triggered | |
token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | |
- uses: actions/[email protected] | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: maven | |
server-id: ossrh | |
server-username: OSSRH_USERNAME | |
server-password: OSSRH_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | |
gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE | |
- name: Build with Maven | |
run: | | |
mvn -ntp -Dmaven.test.failure.ignore=true | |
- name: Check test results | |
run: | | |
# fail the build if failures | |
find . -regex '.*/surefire-reports/.*txt' | xargs sed -n 's/^Tests run: \([0-9]*\), Failures: \([0-9]*\), Errors: \([0-9]*\).*in \(.*\)/\1 \2 \3 \4/p' | awk '$2 + $3 > 0 {print "::error file="$4 "::failures: " $2 "\terrors: " $3 "\t" $4}' | tee report.txt | |
# number of lines is exit code | |
exit $(cat report.txt | wc -l) | |
- name: Publish Unit Test Results | |
uses: EnricoMi/[email protected] | |
if: always() | |
with: | |
junit_files: "**/target/surefire-reports/*.xml" | |
- uses: codecov/codecov-action@v3 | |
if: ${{ ! cancelled()}} | |
- name: Deploy with Maven | |
run: mvn -B -Ddeploy -DskipTests=true deploy | |
if: ${{ github.event_name == 'push' && ! cancelled()}} | |
env: | |
OSSRH_USERNAME: mihxil | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_SECRET_KEY_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }} | |
- name: Commit generated dot file if it changed | |
uses: EndBug/[email protected] | |
with: | |
message: Automated update of dot.m4 | |
add: docs/algebras.dot.m4 |