-
Notifications
You must be signed in to change notification settings - Fork 4
146 lines (127 loc) · 4.37 KB
/
Copy pathtest.yml
File metadata and controls
146 lines (127 loc) · 4.37 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Test
on:
workflow_dispatch:
workflow_call:
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_REGION:
required: true
AWS_S3_BUCKET_NAME:
required: true
jobs:
build:
name: 'Build ACM Package'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: 'maven'
- name: Cache Maven dependencies
uses: actions/cache@v4
if: always()
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build Code
run: mvn -B clean package verify
- name: Upload ACM Package Artifact
uses: actions/upload-artifact@v4
with:
name: acm-package
path: all/target/*.zip
retention-days: 3
- name: Upload ACM Content Example Package Artifact
uses: actions/upload-artifact@v4
with:
name: acm-content-example
path: ui.content.example/target/*.zip
retention-days: 3
test:
name: 'Test ACM Package'
runs-on: ubuntu-latest
needs: build
timeout-minutes: 60
permissions:
contents: read
actions: read
checks: write
env:
AEM_OUTPUT_LOG_MODE: none
FORCE_COLOR: 1
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Setup NodeJS Runtime
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
cache-dependency-path: './test/e2e/package-lock.json'
- name: Setup NodeJS Dependencies
working-directory: ./test/e2e
run: npm ci
- name: Install Playwright Browsers
working-directory: ./test/e2e
run: npx playwright install --with-deps chromium
- name: Download ACM Package Artifact
uses: actions/download-artifact@v4
with:
name: acm-package
path: ./aem/home/lib/acm
- name: Download ACM Content Example Artifact
uses: actions/download-artifact@v4
with:
name: acm-content-example
path: ./aem/home/lib/acm-content-example
- name: Setup AEM Instance
run: |
set -e
echo "Preparing AEM instance"
echo "AEM_PUBLISH_ACTIVE=false" >> .env
mkdir -p aem/home/lib
aws s3 cp --no-progress --only-show-errors s3://${{ secrets.AWS_S3_BUCKET_NAME }}/aem/on-prem/cq-quickstart-6.5.0.jar aem/home/lib/cq-quickstart-6.5.0.jar
aws s3 cp --no-progress --only-show-errors s3://${{ secrets.AWS_S3_BUCKET_NAME }}/aem/on-prem/license.properties aem/home/lib/license.properties
echo "Prepared AEM instance"
echo "Launching AEM instance"
sh aemw instance launch
echo "Launched AEM instance"
- name: Deploy ACM Package
run: |
PACKAGE_PATH=$(find ./aem/home/lib/acm -name "*.zip" | head -1)
echo "Deploying ACM Package '$PACKAGE_PATH'"
sh aemw pkg deploy --file "$PACKAGE_PATH"
echo "Restarting AEM instance to apply repoinit scripts"
sh aemw instance restart
echo "Deployed ACM Package '$PACKAGE_PATH'"
- name: Deploy ACM Content Example Package
run: |
PACKAGE_PATH=$(find ./aem/home/lib/acm-content-example -name "*.zip" | head -1)
echo "Deploying ACM Content Example Package '$PACKAGE_PATH'"
sh aemw pkg deploy --file "$PACKAGE_PATH"
echo "Deployed ACM Content Example Package '$PACKAGE_PATH'"
- name: Run Playwright Tests
working-directory: ./test/e2e
run: npx playwright test
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: acm-playwright-report
path: ./test/e2e/playwright-report/
retention-days: 30