forked from soot-oss/soot
-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (93 loc) · 3.69 KB
/
ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Soot CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
StyleAndLicense:
name: Check style´and license conformity
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Java 8
uses: actions/setup-java@v1
with:
java-version: '8'
- name: Stylecheck
if: always()
run: |
mvn -B clean checkstyle:check -Dcheckstyle.failOnViolation=true
- name: Licensecheck
if: always()
run: |
mvn -B clean license:check-file-header -Dlicence-check.failOnMissingHeader=true
- name: Check version changes
run: |
chmod +x .github/workflows/xml_parser.py
VERSION=$(python3 .github/workflows/xml_parser.py pom.xml)
EXIT_CODE=$(curl -s -o /dev/null -w "%{http_code}" "https://s01.oss.sonatype.org/content/repositories/releases/org/unittestbot/soot/soot-utbot-fork/${VERSION}/")
[[ "${EXIT_CODE}" == "200" ]] && ( echo "Change version to release package!" ; exit 1 ) || true
BuildAndTest:
name: Build and Test with java ${{ matrix.java_version }}
needs: [StyleAndLicense]
runs-on: ubuntu-latest
strategy:
matrix:
java_version: ['8', '9', '11']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Java ${{ matrix.java_version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java_version }}
- name: Build and test Java ${{ matrix.java_version }}
run: |
mvn -B clean test -PJava${{ matrix.java_version }}
DeployArtifacts:
name: Deploy artifacts to Maven Central
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
needs: [BuildAndTest]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Java 8
uses: actions/setup-java@v1
with:
java-version: '8'
- name: Deploy artifacts
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.nexus_username }}
nexus_password: ${{ secrets.nexus_password }}
maven_args: "-DskipTests -Dcheckstyle.failOnViolation=true"
# # has to happen in same job, so that the documention was already created (would require another checkout and maven run otherwise)
# - name: Get Version
# id: version
# run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
#
# - name: Organize documentation files for upload
# shell: bash
# env:
# docdir: ./build/docs
# run: |
# export releasedir=${docdir}/${{ steps.version.outputs.version }} # env variables cannot contain other env variables
# mkdir -p ${releasedir}/jdoc
# unzip ./target/sootclasses-trunk-javadoc.jar -d ${releasedir}/jdoc/
# mkdir -p ${releasedir}/options
# cp ./doc/soot_options.html ${releasedir}/options/
# cp ./doc/soot_options.css ${releasedir}/options/
# cp ./doc/index.html ${docdir}/
#
# - name: Deploy JavaDoc to GH pages
# uses: JamesIves/github-pages-deploy-action@4.1.5
# with:
# branch: gh-pages # The branch the action should deploy to.
# folder: build/ # The folder the action should deploy.
# clean: false # Do not remove existing files in gh-pages