-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (107 loc) · 3.66 KB
/
gradle.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Gradle Build
on:
push:
workflow_dispatch:
concurrency: build-${{ github.ref }}
jobs:
publish_vars:
runs-on: ubuntu-latest
outputs:
publish: ${{ steps.publish_vars.outputs.release != 'true' && (env.ACTUAL_GITHUB_REF == 'refs/heads/master' || startsWith(env.ACTUAL_GITHUB_REF, 'refs/heads/7.')) }}
repo: ${{ steps.publish_vars.outputs.repo }}
steps:
- name: Extract actual github.ref
run: echo "ACTUAL_GITHUB_REF=${ACTUAL_REF}" >> $GITHUB_ENV
env:
ACTUAL_REF: ${{ github.ref }}
- uses: actions/checkout@v4
- name: Get publishing variables
id: publish_vars
uses: enonic/release-tools/publish-vars@master
env:
PROPERTIES_PATH: './gradle.properties'
build:
runs-on: ubuntu-latest
needs: publish_vars
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Prepare Gradle Arguments
run: |
BASE_ARGS="--refresh-dependencies build"
PUBLISH_ARGS="publish -Pcom.enonic.xp.app.production=true -PrepoKey=${{ needs.publish_vars.outputs.repo }} -PrepoUser=ci -PrepoPassword=${{ secrets.ARTIFACTORY_PASSWORD }}"
if [ "${{ needs.publish_vars.outputs.publish }}" == "true" ]; then
GRADLE_ARGS="$BASE_ARGS $PUBLISH_ARGS"
else
GRADLE_ARGS="$BASE_ARGS"
fi
echo "GRADLE_ARGS=$GRADLE_ARGS" >> $GITHUB_ENV
- name: Build with Gradle
run: ./gradlew $GRADLE_ARGS
- uses: actions/upload-artifact@v4
with:
name: app-users
path: build/libs/app-users.jar
- uses: codecov/codecov-action@v5
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
dispatch:
needs: [ publish_vars, build ]
strategy:
matrix:
repo: [ "enonic/xp-distro" ]
runs-on: ubuntu-latest
if: needs.publish_vars.outputs.publish == 'true'
steps:
- name: Workflow Dispatch
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repo: ${{ matrix.repo }}
workflow: gradle.yml
selenium-test:
if: github.event.head_commit.message != 'Updated to next SNAPSHOT version'
strategy:
fail-fast: false
matrix:
suite: [ w_testUsersApp ]
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: actions/download-artifact@v4
with:
name: app-users
path: build/libs/
- name: Run Selenium Tests
id: selenium
run: ./gradlew --refresh-dependencies :testing:${{ matrix.suite }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: notif-build-tests
SLACK_USERNAME: GitHub Actions
SLACK_TITLE: GitHub Action Failure in Users app
SLACK_MESSAGE: ${{job.container.id}}
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_COLOR: ${{ job.status }}
- uses: actions/upload-artifact@v4
if: always() && steps.selenium.conclusion != 'skipped'
with:
name: 'ui-test-report-${{ matrix.suite }}'
path: |
testing/build/reports