-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (62 loc) · 2.37 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
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