Skip to content

MAPAPPS-7318 setup github action #4

MAPAPPS-7318 setup github action

MAPAPPS-7318 setup github action #4

name: run playwright tests
on:
push:
branches: [ dev-playwright ]
pull_request:
branches: [ dev-playwright ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: checkout
uses: actions/checkout@v4
- id: cache-node
name: Cache node modules
uses: actions/cache@v3
with:
path: |
'**/node'
'**/node_modules'
~/.m2/repository
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}
- id: setup-java
name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- id: setup-maven
name: Setup Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.0
- id: create_settings_xml
name: Create settings.xml
uses: whelk-io/maven-settings-xml-action@v22
with:
repositories: >
[
{
"id": "central",
"url": "http://central",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
}
]
plugin_repositories: >
[
{
"id": "central",
"url": "http://central",
"releases": {
"enabled": "true"
},
"snapshots": {
"enabled": "true"
}
}
]
servers: >
[
{
"id": "${{ secrets.NEXUS_ID }}",
"username": "${{ secrets.NEXUS_USER }}",
"password": "${{ secrets.NEXUS_USER_PW }}"
}
]
mirrors: >
[
{
"id": "${{ secrets.NEXUS_ID }}",
"mirrorOf": "central",
"url": "${{ secrets.NEXUS_URL }}"
}
]
- id: tests
name: Run tests
run: mvn prepare-package -B -ntp -Prun-js-tests,include-mapapps-deps
shell: bash
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ./target/e2e-tests-reports
retention-days: 10