Skip to content

168 add saucelabs configuration #146

168 add saucelabs configuration

168 add saucelabs configuration #146

name: pull request snapshot build
on:
pull_request:
branches: [ main ]
# ISSUE does not work
# see https://stackoverflow.com/questions/71070064/github-workflow-excluding-paths-does-not-work
paths-ignore:
- '**.md'
- '.idea/**'
- '.*'
- '/*/.*'
jobs:
matrix-build:
name: ${{ matrix.os }} jdk-${{ matrix.java-version }} build w/o tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
java-version: [ 17, 11, 8 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
settings-path: ${{ github.workspace }}
- name: unix mvn install
if: ${{ !contains(matrix.os, 'windows') }}
run: |
chmod +x mvnw && ./mvnw install \
-s $GITHUB_WORKSPACE/settings.xml \
-Pmode-build-fast,mode-build-quiet
- name: windows mvn install
if: ${{ contains(matrix.os, 'windows') }}
shell: cmd
run: |
mvnw install ^
-s %GITHUB_WORKSPACE%\settings.xml ^
-Pmode-build-fast,mode-build-quiet
verify-for-jdk8:
name: jdk-8 verify
# ISSUE ChromeDriver/GeckoDriver fail to initialize on Ubuntu
# see https://github.com/QA-Automation-Starter/qa-automation/actions/runs/3294884059/jobs/5432863668
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# and https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
# ISSUE Google Search behaves differently on MacOS causing tests to fail
runs-on: windows-latest
environment: development
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven
settings-path: ${{ github.workspace }}
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Setup SSH
uses: webfactory/ssh-agent@v0.6.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# ISSUE causes Error: Container action is only supported on Linux
# - name: Start RabbitMQ
# uses: namoshek/rabbitmq-github-action@v1
# with:
# version: '3.8.9'
# ports: '1883:5672 8883:15672'
# container-name: 'mqtt'
# NOTE: must run install at least in order to have artifacts in .m2
# .m2 artifacts are cached and reused in following generate-automation-project
- name: Maven deploy snapshots
shell: cmd
run: |
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /f /v LongPathsEnabled /t REG_DWORD /d 0x1
git config --global core.longpaths true
git config --global user.name "Adrian Herscu"
git config --global user.email "adrian.herscu@gmail.com"
mvnw deploy ^
-s %GITHUB_WORKSPACE%\settings.xml ^
-Pmode-build-quiet,provider-saucelabs-selenium,testing-tutorials
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
generate-automation-project:
name: generate-build-run-standalone
needs: verify-for-jdk8
runs-on: windows-latest
steps:
- name: setup maven for sonatype snapshots
uses: whelk-io/maven-settings-xml-action@v20
with:
repositories: >
[
{
"id": "ossrh",
"url": "https://s01.oss.sonatype.org/content/repositories/snapshots",
"snapshots": {
"enabled": "true",
"checksumPolicy": "warn"
}
}
]
# FIXME should run with controlled java version
- name: bootstrap maven
uses: aahmed-se/setup-maven@v3
with:
maven-version: 3.6.1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: setup maven cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: setup-java-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
setup-java-${{ runner.os }}-maven-
- name: generate testing project
shell: cmd
# ISSUE https://stackoverflow.com/questions/74581510/using-latest-for-archetypeversion-always-resolves-to-latest-release
# NOTE will use last released archetype
run: |
mvn archetype:generate ^
--batch-mode ^
-Dmaven.wagon.http.ssl.insecure=true ^
-DarchetypeGroupId=dev.aherscu.qa ^
-DarchetypeArtifactId=qa-testing-archetype ^
-DgroupId=com.acme ^
-DartifactId=testing ^
-Dversion=0.0.1-SNAPSHOT ^
-Dpackage=com.acme.testing
- name: build testing project
shell: cmd
run: |
chdir testing && mvnw -Pmode-build-quiet,generate-standalone
- name: run standalone tests executable
shell: cmd
run: |
chdir testing && standalone-tutorials.bat