Skip to content

Commit

Permalink
Update ci to github runners (#921)
Browse files Browse the repository at this point in the history
**Background**

The github runners have [been
updated](https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories)
to more powerful. The new runners should have required amount of RAM to
handle the project of current state.

**Changes**

- Replace self-hosted runners and replace with github runners
ubuntu-latest
- Update some jobs to matrix for concurrency run

**Test plan**
Let's see some of the workflows is fine:

- Check current PR is ok
- Check PR is ok
[HERE](https://github.com/makeevrserg/Flipper-Android-App/actions/runs/10430363915)
- Check that assemble is ok
[HERE](https://github.com/makeevrserg/Flipper-Android-App/actions/runs/10430365770)
  • Loading branch information
makeevrserg committed Aug 28, 2024
1 parent 9ecb62a commit 5345398
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
gradle/**
gradle.properties
matrx_update_gradle:
name: "Build ${{ matrix.target }}"
name: "Build all variants"
runs-on: ubuntu-latest
needs: check_gradle_files_change
if: needs.check_gradle_files_change.outputs.GRADLE_FILES_CHANGED == 'true'
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/call-create-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
baseline_file:
name: Upload baseline profile file
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
outputs:
BUILD_VARIANT_NAME: ${{ steps.create_uppercase_variant.outputs.BUILD_VARIANT_NAME }}
BASELINE_FILE_ID: ${{ steps.create_baseline_file_id.outputs.BASELINE_FILE_ID }}
Expand Down Expand Up @@ -62,25 +62,12 @@ jobs:
echo "BASELINE_FILE_PATH=${baseline_file_path}" >> $GITHUB_OUTPUT
# On Flipper self-hosted we don't have it so install locally in current container
- name: Setup libx11
# Make kvm able to launch emulator
- name: Enable KVM group perms
run: |
export DEBIAN_FRONTEND=noninteractive;
sudo apt update;
sudo apt install -y libx11-6;
# We need to install specific platforms for this job which is not present inside self-hosted VM
- name: Setup Platform-android-34
run: |
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platforms;android-34"
# Remember current user ANDROID_HOME location to use it via sudo
# steps.share_android_home.ANDROID_HOME
- name: Share ANDROID_HOME location
id: share_android_home
run: |
android_home="$ANDROID_HOME"
echo "ANDROID_HOME=$android_home" >> $GITHUB_OUTPUT
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
# steps.create_baseline_task.outputs.BASELINE_TASK
- id: create_baseline_task
Expand All @@ -95,9 +82,9 @@ jobs:
# Here also specified ANDROID environment variables for sudo command
- name: Run baseline profiles
run: |
sudo ANDROID_SDK_ROOT=${{ steps.share_android_home.outputs.ANDROID_HOME }} ANDROID_HOME=${{ steps.share_android_home.outputs.ANDROID_HOME }} ANDROID_AVD_HOME=${{ steps.share_android_home.outputs.ANDROID_HOME }}/avd ./gradlew ${{ steps.create_baseline_task.outputs.BASELINE_TASK }}
./gradlew ${{ steps.create_baseline_task.outputs.BASELINE_TASK }}
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
name: "Upload baseline file"
with:
name: ${{ steps.create_baseline_file_id.outputs.BASELINE_FILE_ID }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: ./.github/workflows/call-validate-gradle-wrapper.yml
invalidate_gradle_cache:
name: Update gradle cache
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
BUILD_VARIANT_NAME: "internal"
build_internal_release:
name: Build Internal AAB and APK
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
needs: [ create_internal_baseline, build_number ]
strategy:
matrix:
Expand All @@ -73,7 +73,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: 'recursive'
- uses: actions/download-artifact@master
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: "Download ${{ needs.create_internal_baseline.outputs.BUILD_VARIANT_NAME }} baseline file"
with:
name: ${{ needs.create_internal_baseline.outputs.BASELINE_FILE_ID }}
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
path: ${{ steps.artifacts_copy.outputs.path }}
build_internal_release_gms_wearos:
name: Build Internal AAB and APK WearOS
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
needs: build_number
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
BUILD_VARIANT_NAME: "internal"
build_internal_release:
name: Build Internal AAB and APK
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
needs: [ create_internal_baseline, build_number ]
strategy:
matrix:
Expand All @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
submodules: 'recursive'
- uses: actions/download-artifact@master
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: "Download ${{ needs.create_internal_baseline.outputs.BUILD_VARIANT_NAME }} baseline file"
with:
name: ${{ needs.create_internal_baseline.outputs.BASELINE_FILE_ID }}
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
path: ${{ steps.artifacts_copy.outputs.path }}
build_internal_release_gms_wearos:
name: Build Internal AAB and APK WearOS
runs-on: [ self-hosted, AndroidShell ]
runs-on: ubuntu-latest
needs: build_number
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
name: "Validate CHANGELOG changed"
uses: ./.github/workflows/call-check-changelog.yml
update_gradle_cache:
name: "Gradle cache update"
name: "Gradle configuration change check"
needs: [ validate_gradle_wrapper ]
uses: ./.github/workflows/call-gradle-cache.yml
uses: ./.github/workflows/call-configuration-change.yml
info:
name: "Display concurrency info"
runs-on: ubuntu-latest
Expand All @@ -45,6 +45,9 @@ jobs:
name: "Run unit tests"
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
strategy:
matrix:
target: [ "testDebugUnitTest", "desktopTest" ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand All @@ -54,14 +57,17 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- name: Unit test
- name: "Test ${{ matrix.target }}"
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
with:
arguments: testDebugUnitTest desktopTest
arguments: ${{ matrix.target }}
detekt:
name: "Check project by detekt and android`s lint"
name: "Check project by linters"
runs-on: ubuntu-latest
needs: [ validate_gradle_wrapper ]
strategy:
matrix:
target: [ "detektMain", "lint" ]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
Expand All @@ -71,7 +77,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- name: detekt
- name: "Lint by ${{ matrix.target }}"
uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3
with:
arguments: detektMain lint
arguments: ${{ matrix.target }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/download-artifact@master
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
name: "Download ${{ needs.create_release_baseline.outputs.BUILD_VARIANT_NAME }} baseline file"
with:
name: ${{ needs.create_release_baseline.outputs.BASELINE_FILE_ID }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Attention: don't forget to add the flag for F-Droid before release
- [CI] Update deps
- [CI] Merge CI workflows in one
- [CI] Update CI changed-files action
- [CI] Update CI for github runners

# 1.7.1

Expand Down

0 comments on commit 5345398

Please sign in to comment.