mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Remove the GitHub Actions workflows
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
name: Baseline profile
|
||||
|
||||
# Records a fresh app/src/main/baseline-prof.txt on an emulator and pushes it to the
|
||||
# ci/baseline-profile branch for review. Run it from the Actions tab or push to profile/<anything>.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ["profile/**"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
profile:
|
||||
if: github.server_url == 'https://github.com'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
# Rules must use the names from the source, so the profile is recorded on a build without R8
|
||||
- name: Build a non-minified release APK
|
||||
run: |
|
||||
sed -i 's/isMinifyEnabled = true/isMinifyEnabled = false/; s/isShrinkResources = true/isShrinkResources = false/' app/build.gradle.kts
|
||||
./gradlew :app:assembleRelease -q
|
||||
keytool -genkeypair -keystore "$RUNNER_TEMP/p.jks" -storepass profile -keypass profile -alias p \
|
||||
-keyalg RSA -keysize 2048 -validity 365 -dname "CN=profile" >/dev/null 2>&1
|
||||
apksigner="$(ls -d "$ANDROID_HOME"/build-tools/*/ | sort -V | tail -n 1)apksigner"
|
||||
"$apksigner" sign --ks "$RUNNER_TEMP/p.jks" --ks-pass pass:profile --out "$RUNNER_TEMP/app.apk" \
|
||||
app/build/outputs/apk/release/app-release-unsigned.apk
|
||||
git checkout app/build.gradle.kts
|
||||
|
||||
- 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: Record the profile
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 34
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
profile: pixel_6
|
||||
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
script: bash scripts/baseline-profile.sh "$RUNNER_TEMP/app.apk" "$RUNNER_TEMP/baseline-prof.txt"
|
||||
|
||||
- name: Push it for review
|
||||
run: |
|
||||
sort -u "$RUNNER_TEMP/baseline-prof.txt" > "$RUNNER_TEMP/sorted.txt"
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git checkout --orphan profile-output
|
||||
git rm -rq --cached .
|
||||
cp "$RUNNER_TEMP/sorted.txt" baseline-prof.txt
|
||||
git add baseline-prof.txt
|
||||
git commit -qm "Baseline profile recorded from ${GITHUB_SHA::7}"
|
||||
git push -f origin HEAD:refs/heads/ci/baseline-profile
|
||||
echo "::notice title=Baseline profile::$(wc -l < baseline-prof.txt) rules pushed to ci/baseline-profile"
|
||||
@@ -1,64 +0,0 @@
|
||||
name: Benchmark
|
||||
|
||||
# Compares two revisions on one emulator: cold start, memory, background CPU, scroll jank, APK size.
|
||||
# Run it from the Actions tab, or push the commit to measure to a bench/<anything> branch.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
base:
|
||||
description: Baseline revision
|
||||
default: origin/main
|
||||
rounds:
|
||||
description: Rounds per APK (each has 10 cold starts)
|
||||
default: "3"
|
||||
push:
|
||||
branches: ["bench/**"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
bench:
|
||||
if: github.server_url == 'https://github.com'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 150
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build base and head APKs
|
||||
run: bash scripts/bench-build.sh "${{ inputs.base || 'origin/main' }}" "${{ github.sha }}" "$RUNNER_TEMP/bench"
|
||||
|
||||
- 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: Measure on the emulator
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: 34
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
profile: pixel_6
|
||||
disable-animations: false
|
||||
emulator-options: -no-snapshot -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
script: bash scripts/bench.sh "$RUNNER_TEMP/bench/base.apk" "$RUNNER_TEMP/bench/head.apk" "${{ inputs.rounds || '3' }}"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: bench-results
|
||||
path: |
|
||||
${{ runner.temp }}/bench/*.csv
|
||||
${{ runner.temp }}/bench/*.md
|
||||
if-no-files-found: ignore
|
||||
@@ -1,53 +0,0 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# The Gitea instance has no Android SDK on its runners; this only runs on the GitHub mirror
|
||||
if: github.server_url == 'https://github.com'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build and unit-test every pushed commit
|
||||
run: bash scripts/ci-check.sh "${{ github.event.before }}" "${{ github.sha }}"
|
||||
|
||||
- name: Release build (R8)
|
||||
run: ./gradlew :app:assembleRelease --stacktrace
|
||||
|
||||
- name: APK size and key dependencies
|
||||
run: |
|
||||
apk=$(ls app/build/outputs/apk/release/*.apk | head -n 1)
|
||||
echo "::notice title=Release APK::$(stat -c %s "$apk") bytes ($(basename "$apk"))"
|
||||
prof=$(unzip -l "$apk" assets/dexopt/baseline.prof | awk '/baseline.prof/ {print $1}')
|
||||
echo "::notice title=Baseline profile in APK::${prof:-missing} bytes"
|
||||
deps=$(./gradlew -q :app:dependencies --configuration releaseRuntimeClasspath \
|
||||
| grep -oE '(androidx\.lifecycle:lifecycle-runtime-compose|androidx\.profileinstaller:profileinstaller|com\.squareup\.okhttp3:okhttp):[^ ]+( -> [^ ]+)?' \
|
||||
| sort -u | paste -sd ';' -)
|
||||
echo "::notice title=Dependencies::$deps"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: apk
|
||||
path: |
|
||||
app/build/outputs/apk/**/*.apk
|
||||
app/build/outputs/mapping/release/mapping.txt
|
||||
if-no-files-found: ignore
|
||||
Reference in New Issue
Block a user