-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (107 loc) · 4.11 KB
/
vertx-parent.yaml
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
name: vertx-parent
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 8 * * *' # Cron job to run daily at 8AM UTC (at midnight PDT)
jobs:
test:
name: Test
runs-on: ubuntu-20.04
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
- name: Set up OAuth2 access token for Maven
run: |
echo "ACCESS_TOKEN=$(gcloud auth print-access-token)" >> $GITHUB_ENV
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Copy Maven settings
run: |
mkdir -p ~/.m2
cp ./travis/actions-maven-settings.xml $HOME/.m2/settings.xml
- name: Update versions for non-SNAPSHOT builds
run: |
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" vertx-parent-files/pom.xml
- name: Run Tests
run: |
echo "Running Tests"
mvn -Dmaven.wagon.http.retryHandler.count=3 -e test --settings $HOME/.m2/settings.xml
mvn --batch-mode install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheck1 --settings $HOME/.m2/settings.xml
mvn --batch-mode install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheck2 --settings $HOME/.m2/settings.xml
mvn -Dmaven.wagon.http.retryHandler.count=3 -e verify --settings $HOME/.m2/settings.xml
- name: Show Surefire Reports after failure
if: failure()
run: |
echo "\n=== SUREFIRE REPORTS ===\n"
for F in target/surefire-reports/*.txt; do echo $F; cat $F; echo; done
deploy_snapshots:
name: Deploy Snapshots
runs-on: ubuntu-20.04
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: 'som-rit-infrastructure-prod'
workload_identity_provider: 'projects/294515190965/locations/global/workloadIdentityPools/github/providers/susom-github'
create_credentials_file: true
export_environment_variables: true
cleanup_credentials: true
- name: Set up OAuth2 access token for Maven
run: |
echo "ACCESS_TOKEN=$(gcloud auth print-access-token)" >> $GITHUB_ENV
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Copy Maven settings
run: |
mkdir -p ~/.m2
cp ./travis/actions-maven-settings.xml $HOME/.m2/settings.xml
- name: Update versions for non-SNAPSHOT builds
run: |
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" pom.xml
sed -i "s/-SNAPSHOT/-build-${{ github.run_number }}/" vertx-parent-files/pom.xml
- name: Deploy Snapshots
run: |
echo "Deploying snapshots"
mvn -s $HOME/.m2/settings.xml -Dmaven.wagon.http.retryHandler.count=3 --batch-mode -e -DskipTests=true deploy
if: github.ref == 'refs/heads/master'