Skip to content

init commit

init commit #18

Workflow file for this run

name: run
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "**" ]
# Concurrency control to cancel previous runs on new commits
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
java: [17]
os: [ubuntu-latest, ubuntu-22.04]
browser: [chrome]
fail-fast: false
env:
DISPLAY: ':99'
MAVEN_OPTS: '-Xmx2048m'
BROWSER: ${{ matrix.browser }}
steps:
- uses: actions/checkout@v4.1.7
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4.3.0
with:
java-version: '${{ matrix.java }}'
distribution: 'temurin'
cache: maven
- name: Cache Maven dependencies
uses: actions/cache@v4.2.3
with:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up Chrome
if: matrix.browser == 'chrome'
uses: browser-actions/setup-chrome@v1.7.2
with:
chrome-version: stable
- name: Start Xvfb
run: |
sudo Xvfb :99 -ac -screen 0 1280x1024x24 > /dev/null 2>&1 &
sleep 3
- name: Validate environment
run: |
echo "Java version:"
java -version
echo "Maven version:"
mvn -version
echo "Browser: ${{ matrix.browser }}"
if [ "${{ matrix.browser }}" = "chrome" ]; then
echo "Chrome version:"
google-chrome --version
fi
echo "Display: $DISPLAY"
- name: Test
run: mvn clean install -P headless-github -B -T 1C -Dbrowser=${{ matrix.browser }}
continue-on-error: false
timeout-minutes: 20
- name: Upload test reports
uses: actions/upload-artifact@v4.4.0
if: always()
with:
name: test-reports-java${{ matrix.java }}-${{ matrix.os }}-${{ matrix.browser }}
path: |
**/target/surefire-reports/
**/target/allure-results/
**/target/cucumber/
**/logs/
retention-days: 30
- name: Upload screenshots on failure
uses: actions/upload-artifact@v4.4.0
if: failure()
with:
name: screenshots-java${{ matrix.java }}-${{ matrix.os }}-${{ matrix.browser }}
path: |
**/target/screenshots/
**/target/test-output/
retention-days: 7
- name: Cleanup
if: always()
run: |
pkill -f Xvfb || true
pkill -f chrome || true