False test #560
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: pull request | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
env-job: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
outputs: | |
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }} | |
name: Modify branch name | |
steps: | |
- name: Sets MODIFIED_BRANCH_NAME | |
id: env | |
env: | |
name: "${{env.BRANCH_NAME}}" | |
run: | | |
echo "MODIFIED_BRANCH_NAME=${name//\//-}" >> ${GITHUB_OUTPUT} | |
cat ${GITHUB_OUTPUT} | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ macOS-13 ] | |
api: [ 28 ] | |
abi: [ x86_64 ] | |
tag: [ default ] | |
emulatorApi: [ 9 ] | |
java_version: [ 17 ] | |
needs: | |
- env-job | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: show envs | |
run: | | |
echo ${{ needs.env-job.outputs.modified-branch-name }} | |
- uses: gradle/wrapper-validation-action@v3 | |
- name: prepare | |
run: brew install exiftool imagemagick | |
- name: set up JDK ${{ matrix.java_version }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java_version }} | |
- name: Install Android SDK | |
uses: hannesa2/action-android/[email protected] | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
- name: Run tests | |
run: ./gradlew test | |
- name: Run instrumentation tests | |
uses: hannesa2/action-android/[email protected] | |
with: | |
cmd: ./gradlew cAT --continue | |
api: ${{ matrix.api }} | |
tag: ${{ matrix.tag }} | |
abi: ${{ matrix.abi }} | |
cmdOptions: -noaudio -no-boot-anim -no-window -metrics-collection | |
- name: Archive Espresso results | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: SlidingUp-Espresso-report | |
path: demo/build/reports/androidTests/connected | |
- name: Archive screenshots | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SlidingUp-Screenshots-${{ needs.env-job.outputs.modified-branch-name }} | |
path: | | |
demo/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected | |
demo/build/outputs/androidTest-results/connected | |
- name: Compare screenshots | |
env: | |
CLASSIC_TOKEN: ${{ secrets.CLASSIC_TOKEN }} | |
emulatorApi: ${{ matrix.emulatorApi }} | |
run: | | |
ls -ls demo/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected | |
cp demo/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator\(AVD\)\ -\ ${{ matrix.emulatorApi }}/* screenshotsToCompare${{ matrix.emulatorApi }} | |
export DISPLAY=:99 | |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & | |
./screenShotScript/screenShotCompare.sh | |
- name: Archive screenshots diffs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: SlidingUp-diffs-${{ needs.env-job.outputs.modified-branch-name }} | |
path: | | |
screenshotDiffs | |
- name: Show git status | |
if: ${{ always() }} | |
run: | | |
ls -la artifacts | |
git add screenshotsToCompare${{ matrix.emulatorApi }} | |
git status | |
[ "$(git status -s -uno)" ] && exit 1 || exit 0 |