Skip to content

Bump androidx.annotation:annotation from 1.8.2 to 1.9.1 #48

Bump androidx.annotation:annotation from 1.8.2 to 1.9.1

Bump androidx.annotation:annotation from 1.8.2 to 1.9.1 #48

# MIT License
#
# Copyright (c) 2021 - 2022 ViliusSutkus89.com
#
# https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests
# .github/workflows/unprivilegedBuild.yml - v2.1.1
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
name: unprivilegedBuild
on:
workflow_dispatch:
push:
branches-ignore: [ master, main ]
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/unprivilegedBuild.yml'
pull_request:
paths-ignore:
- '**.md'
- '.github/**'
- '!.github/workflows/unprivilegedBuild.yml'
permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none
jobs:
buildLibrary:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- uses: android-actions/setup-android@v3
- run: ./gradlew build lintRelease
- uses: actions/upload-artifact@v4
with:
name: library-lint-report
path: tmpfile/build/reports/lint-results-release.html
- run: ./gradlew publishToMavenLocal
- uses: actions/upload-artifact@v4
with:
name: maven-local
path: ~/.m2
runInstrumentedTests:
needs: buildLibrary
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- {'api-level': 35, 'api-type-target': 'google_apis', 'arch': 'x86_64'}
- {'api-level': 34, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 33, 'api-type-target': 'aosp_atd', 'arch': 'x86_64'}
- {'api-level': 32, 'api-type-target': 'aosp_atd', 'arch': 'x86_64'}
- {'api-level': 31, 'api-type-target': 'aosp_atd', 'arch': 'x86_64'}
- {'api-level': 30, 'api-type-target': 'aosp_atd', 'arch': 'x86_64'}
- {'api-level': 30, 'api-type-target': 'aosp_atd', 'arch': 'x86'}
- {'api-level': 29, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 29, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 28, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 28, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 27, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 27, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 26, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 26, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 25, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 25, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 24, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 24, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 23, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 23, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 22, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 22, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 21, 'api-type-target': 'default', 'arch': 'x86_64'}
- {'api-level': 21, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 19, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 18, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 17, 'api-type-target': 'default', 'arch': 'x86'}
- {'api-level': 16, 'api-type-target': 'default', 'arch': 'x86'}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- uses: android-actions/setup-android@v3
- uses: actions/download-artifact@v4
with:
name: maven-local
path: ~/.m2
- name: Prepare library to run instrumented tests on staging library
run: ./ci-scripts/prepareLibraryTestsForStagingRepository tests --output=build/lib-staging --repository=mavenLocal
- name: Enable KVM group perms
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: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.api-type-target }}
sdcard-path-or-size: 1G
disk-size: 8G
working-directory: build/lib-staging
script: |
mkdir -p testResults/screenshots
adb logcat > testResults/logcat.txt &
adb shell screencap /data/local/tmp/beforeTests.png
adb pull /data/local/tmp/beforeTests.png testResults/screenshots/
./gradlew connectedCheck || touch sorry_but_tests_are_failing
adb pull /sdcard/Pictures/screenshots testResults/ || true
adb shell screencap /data/local/tmp/afterTests.png
adb pull /data/local/tmp/afterTests.png testResults/screenshots/
mv tests/build/reports/androidTests/connected testResults/
mv tests/build/outputs/androidTest-results testResults/
test ! -f sorry_but_tests_are_failing
- uses: actions/upload-artifact@v4
if: always()
with:
name: testResults-${{ matrix.api-level }}-${{ matrix.arch }}-${{ matrix.api-type-target }}
path: build/lib-staging/testResults
if-no-files-found: error
buildSampleAppAgainstUnreleasedLibrary:
needs: buildLibrary
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- uses: android-actions/setup-android@v3
- uses: actions/download-artifact@v4
with:
name: maven-local
path: ~/.m2
- name: Prepare sample app for staging repository
run: ./ci-scripts/prepareSampleAppForStagingRepository sampleapp app --output=build/sampleapp-staging --repository=mavenLocal
- name: Build and lint sample app from staging library
run: ./gradlew build lintRelease
working-directory: build/sampleapp-staging
- uses: actions/upload-artifact@v4
with:
name: APKs
path: build/sampleapp-staging/app/build/outputs/apk/**/*.apk
if-no-files-found: error
- uses: actions/upload-artifact@v4
with:
name: sampleapp-lint-report
path: build/sampleapp-staging/app/build/reports/lint-results-release.html
if-no-files-found: error