-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (70 loc) · 2.17 KB
/
application-pull-request.yaml
File metadata and controls
81 lines (70 loc) · 2.17 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
name: Application - Pull Request
on:
workflow_call:
inputs:
application-name:
required: true
type: string
install-dependencies:
type: boolean
default: false
dockerfile-location:
type: string
default: ./
run-tests:
type: boolean
default: false
tests-package:
type: string
image-property-name:
type: string
default: "app.image"
env:
APP_IMAGE: ${{ inputs.application-name }}:test
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK Corretto 21
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
architecture: x64
# Application setup
- name: Install NodeJS
if: ${{ inputs.install-dependencies }}
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Build Application
run: |
cd ${{ inputs.dockerfile-location }}
if [ "${{ inputs.install-dependencies }}" = "true" ]; then
echo "Installing dependencies..."
echo "@codbex:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" >> .npmrc
npm install
rm -rf .npmrc
fi
docker build -t $APP_IMAGE .
- name: Run Tests
if: ${{ inputs.run-tests }}
run: |
# Verify images exist
docker inspect $APP_IMAGE
mvn clean install -P integration-tests "-Dit.test=${{ inputs.tests-package }}" -D${{ inputs.image-property-name }}=$APP_IMAGE
- name: Generate a random artifact name
if: always()
id: generate_name
run: |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
echo "ARTIFACT_NAME=selenide-screenshots-${TIMESTAMP}.zip" >> $GITHUB_ENV
- name: Upload selenide screenshots
uses: actions/upload-artifact@v4
if: always()
with:
retention-days: 1
name: ${{ env.ARTIFACT_NAME }}
path: integration-tests/build/reports/tests