-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (83 loc) · 2.94 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
name: CI
on:
push:
workflow_dispatch:
env:
GRADLE_OPTS: >-
-Dorg.gradle.project.org.alfresco.maven.nexus.username=${{ secrets.ALFRESCO_NEXUS_USERNAME }}
-Dorg.gradle.project.org.alfresco.maven.nexus.password=${{ secrets.ALFRESCO_NEXUS_PASSWORD }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Test
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: test
- name: Upload analysis to sonarcloud
uses: gradle/gradle-build-action@v2
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
with:
cache-read-only: false
arguments: sonarqube
integration-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flavour: [ "community", "enterprise" ]
version: [ "61", "62", "70", "71", "72", "73","74" ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Login to Docker
env:
DOCKER_HUB_USER: ${{ secrets.XENIT_DOCKER_REGISTRY_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.XENIT_DOCKER_REGISTRY_PASSWORD }}
DOCKER_CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
DOCKER_CLOUDSMITH_PASSWORD: ${{ secrets.CLOUDSMITH_APIKEY }}
run: |
echo "$DOCKER_CLOUDSMITH_PASSWORD" | docker login private.docker.xenit.eu --username "$DOCKER_CLOUDSMITH_USER" --password-stdin
- name: Integration Test
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
arguments: :integration-tests:alfresco-${{ matrix.flavour }}-${{ matrix.version }}:integrationTest
- name: 'Upload Test Reports'
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test-result-${{ matrix.flavour }}-${{ matrix.version }}
path: /home/runner/**/build/reports
retention-days: 14
publish:
needs: [ test, integration-test ]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/heads/master') || startswith(github.ref, 'refs/heads/release') }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Publish
env:
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }}
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
run: ./gradlew publish --info