Merge pull request #329 from giulong/dependabot/maven/develop/org.moc… #1060
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 | |
on: | |
push: | |
branches: [ "develop", "feature/**", "bugfix/**" ] | |
pull_request: | |
branches: [ "develop" ] | |
types: [ opened, reopened, edited ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.VERSION }} | |
steps: | |
- name: Free Disk Space | |
shell: bash | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4.0.0 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: maven | |
- name: Build Spectrum | |
shell: bash | |
run: ./mvnw install -DskipSign -Dmaven.plugin.validation=NONE -ntp -P framework-only | |
- name: Get Spectrum version | |
id: get-version | |
run: | | |
VERSION=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout ) | |
echo "Spectrum version is $VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
- name: Store Spectrum jar | |
uses: actions/upload-artifact@v4 | |
with: | |
name: spectrum-jar | |
path: spectrum/target/spectrum-${{ env.VERSION }}.jar | |
browsers: | |
name: Browsers IT | |
needs: build | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
include: | |
- os: ubuntu-latest | |
profiles: browsers | |
directives: -DbrowsersTests | |
moduleName: it | |
env: | |
EDGE_BINARY: /usr/bin/microsoft-edge | |
- os: macos-latest | |
profiles: macos | |
directives: -DmacosTests | |
moduleName: it-macos | |
env: | |
EDGE_BINARY: /usr/bin/microsoft-edge | |
- os: windows-latest | |
profiles: browsers | |
directives: -DbrowsersTests | |
moduleName: it | |
runs-on: ${{ matrix.os }} | |
env: | |
VERSION: ${{ needs.build.outputs.version }} | |
steps: | |
- name: Free Disk Space | |
if: ${{ matrix.os != 'windows-latest' }} | |
shell: bash | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4.0.0 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: maven | |
- name: Get Spectrum jar | |
uses: actions/download-artifact@v4 | |
with: | |
name: spectrum-jar | |
- name: Run browsers ITs | |
shell: bash | |
run: | | |
./mvnw install:install-file -ntp -Dfile=$GITHUB_WORKSPACE/spectrum-${{ env.VERSION }}.jar -DgroupId=io.github.giulong -DartifactId=spectrum -Dversion=${{ env.VERSION }} -Dpackaging=jar | |
./mvnw install -DskipSign -Dmaven.plugin.validation=NONE ${{ matrix.directives }} -ntp -P ${{ matrix.profiles }} | |
- name: Publish html report | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: report-${{ matrix.moduleName }}-${{ matrix.os }} | |
path: ${{ matrix.moduleName }}/target/spectrum/inline-reports | |
appium: | |
name: Appium IT | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
VERSION: ${{ needs.build.outputs.version }} | |
steps: | |
- name: Free Disk Space | |
shell: bash | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4.0.0 | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: maven | |
- name: Enable KVM | |
run: | | |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | |
sudo udevadm control --reload-rules | |
sudo udevadm trigger --name-match=kvm | |
- name: AVD cache | |
uses: actions/cache@v4 | |
id: avd-cache | |
with: | |
path: | | |
~/.android/avd/* | |
~/.android/adb* | |
key: avd | |
- name: Install and Run Appium Server | |
run: | | |
npm i -g appium | |
appium driver install uiautomator2 | |
appium &>/dev/null & | |
- name: create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
arch: x86_64 | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
script: echo "Generated AVD snapshot for caching." | |
- name: Get Spectrum jar | |
uses: actions/download-artifact@v4 | |
with: | |
name: spectrum-jar | |
- name: run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 31 | |
arch: x86_64 | |
avd-name: phone | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
./mvnw install:install-file -ntp -Dfile=$GITHUB_WORKSPACE/spectrum-${{ env.VERSION }}.jar -DgroupId=io.github.giulong -DartifactId=spectrum -Dversion=${{ env.VERSION }} -Dpackaging=jar | |
./mvnw install -DskipSign -Denforcer.skip -Dmaven.plugin.validation=NONE -DappiumTests -ntp -P appium | |
- name: Publish html report | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: report-it-appium | |
path: it-appium/target/spectrum/inline-reports |