Update actions/upload-artifact action to v4.4.3 #949
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: | |
- master | |
pull_request: | |
types: [ opened, labeled, unlabeled, synchronize ] | |
env: | |
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false" | |
JAVA_VERSION: 11 | |
ANDROID_API_LEVEL: 23 | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Checkout Project | |
uses: actions/[email protected] | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Configure JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-home-cache-cleanup: true | |
- run: ./gradlew --version | |
- name: Run Ktlint Check On All Sources | |
run: ./gradlew ktlintCheck -s | |
- name: Run Build and Unit Tests | |
run: ./gradlew build -s | |
- name: Publish to maven local to run instrumentation tests | |
run: rm -rf ~/.m2/repository/com/jaredsburrows/gradle-spoon-plugin/ && ./gradlew publishToMavenLocal -x test -s | |
- 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: Create AVD and generate snapshot for caching | |
if: steps.avd-cache.outputs.cache-hit != 'true' | |
uses: reactivecircus/[email protected] | |
with: | |
api-level: ${{ env.ANDROID_API_LEVEL }} | |
arch: x86_64 | |
target: google_apis | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: false | |
script: echo "Generated AVD snapshot for caching." | |
- name: Run Instrumentation Tests on Android API ${{ env.ANDROID_API_LEVEL }} | |
uses: reactivecircus/[email protected] | |
with: | |
api-level: ${{ env.ANDROID_API_LEVEL }} | |
arch: x86_64 | |
target: google_apis | |
force-avd-creation: false | |
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save | |
disable-animations: true | |
script: cd test-app && ../gradlew clean spoonDebugAndroidTest checkReports -s && cd .. | |
- name: Publish Test Report | |
uses: EnricoMi/[email protected] | |
if: always() | |
with: | |
comment_mode: off | |
files: '**/build/test-results/test/TEST-*.xml' | |
- name: Upload Artifacts | |
uses: actions/[email protected] | |
if: github.repository == 'jaredsburrows/gradle-spoon-plugin' && github.ref == 'refs/heads/master' | |
with: | |
name: gradle-spoon-plugin-${{ github.workflow }}-${{ github.run_id }} | |
path: | | |
build/libs | |
build/outputs | |
build/publications | |
build/distributions | |
build/reports | |
build/test-results | |
publish: | |
name: Publish Snapshot | |
runs-on: ubuntu-latest | |
if: github.repository == 'jaredsburrows/gradle-spoon-plugin' && github.ref == 'refs/heads/master' | |
needs: | |
- build | |
steps: | |
- name: Checkout Project | |
uses: actions/[email protected] | |
- name: Validate Gradle Wrapper | |
uses: gradle/actions/wrapper-validation@v4 | |
- name: Configure JDK ${{ env.JAVA_VERSION }} | |
uses: actions/[email protected] | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
gradle-home-cache-cleanup: true | |
- run: ./gradlew --version | |
- name: Publish | |
run: ./gradlew publish -s -i | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} |