added Browserstack support: #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test in DevVer and SIT | |
env: | |
ACTIONS_STEP_DEBUG: true | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
DevVer: | |
runs-on: [self-hosted] | |
strategy: | |
matrix: | |
browser: [ chrome ] | |
profile: [ Localtests ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache JDK | |
uses: actions/[email protected] | |
with: | |
path: | | |
~/jdk | |
key: ${{ runner.os }}-jdk19-${{ hashFiles('**/pom.xml') }} | |
- name: Start timing | |
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
cache: maven | |
- name: End timing | |
run: | | |
END_TIME=$(date +%s) | |
echo "Process took $((END_TIME - START_TIME)) seconds to complete" | |
- name: Start timing | |
run: echo "START_TIME=$(date +%s)" >> $GITHUB_ENV | |
- name: Build & Test DevVer with Maven | |
run: mvn -B package --file pom.xml -Denvironment=DevVer -Dbrowser=${{ matrix.browser }} -P ${{ matrix.profile}} | |
- name: End timing | |
run: | | |
END_TIME=$(date +%s) | |
echo "Process took $((END_TIME - START_TIME)) seconds to complete" | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DevVer test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
DevInt: | |
runs-on: [self-hosted] | |
needs: DevVer | |
strategy: | |
matrix: | |
browser: [ chrome, firefox ] | |
profile: [ Localtests ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build & Test DevInt with Maven | |
run: mvn -B package --file pom.xml -Denvironment=DevInt -Dbrowser=${{ matrix.browser }} -P ${{ matrix.profile}} | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: DevInt test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
SIT: | |
runs-on: [self-hosted] | |
needs: DevInt | |
strategy: | |
matrix: | |
browser: [ chrome,firefox ] | |
profile: [ Browserstack ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build & test SIT with Maven | |
run: mvn -B package --file pom.xml -D environment=SIT -D browser=${{ matrix.browser }} -P ${{ matrix.profile}} | |
# - name: Remove remove previous Docker DevInt container instance | |
# run: docker rm -f SIT | |
# - name: Build Docker image | |
# run: docker build . --file Dockerfile_SIT --tag cicd_project_image:SIT | |
# - name: Run docker image | |
# run: docker run --name SIT cicd_project_image:SIT | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SIT test results ${{ matrix.browser }} - ${{ github.run_id }} | |
path: target/surefire-reports/ | |
Production: | |
runs-on: [self-hosted] | |
needs: SIT | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 19 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '19' | |
distribution: 'temurin' | |
cache: maven |