mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 08:15:02 +00:00
ci: run the heavy Gradle jobs on the self-hosted runners
Requires the Android SDK in the runner image. Also gates the disk-cleanup step to hosted runners, where it would otherwise strip the host.
This commit is contained in:
@@ -21,7 +21,7 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Build APKs
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
permissions:
|
||||
# A job-level block replaces the workflow-level one, so contents:read has to be
|
||||
# repeated here or checkout fails on this private fork.
|
||||
@@ -38,6 +38,9 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
@@ -21,7 +21,7 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
name: Build Enterprise APKs
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Skip in forks
|
||||
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'element-hq/element-x-android' }}
|
||||
strategy:
|
||||
@@ -34,6 +34,9 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
@@ -23,12 +23,15 @@ env:
|
||||
jobs:
|
||||
build-apk:
|
||||
name: Build APK
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
concurrency:
|
||||
group: ${{ format('maestro-build-{0}', github.ref) }}
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
@@ -24,6 +24,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
@@ -67,7 +70,7 @@ jobs:
|
||||
|
||||
checkDependencies:
|
||||
name: Search for invalid dependencies
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
@@ -91,7 +94,7 @@ jobs:
|
||||
# Code checks
|
||||
konsist:
|
||||
name: Konsist tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('check-konsist-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-konsist-develop-{0}', github.sha) || format('check-konsist-{0}', github.ref) }}
|
||||
@@ -132,7 +135,7 @@ jobs:
|
||||
|
||||
compose:
|
||||
name: Compose tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('check-compose-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-compose-develop-{0}', github.sha) || format('check-compose-{0}', github.ref) }}
|
||||
@@ -166,7 +169,7 @@ jobs:
|
||||
|
||||
lint:
|
||||
name: Android lint check
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('check-lint-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-lint-develop-{0}', github.sha) || format('check-lint-{0}', github.ref) }}
|
||||
@@ -211,7 +214,7 @@ jobs:
|
||||
|
||||
detekt:
|
||||
name: Detekt checks
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('check-detekt-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-detekt-develop-{0}', github.sha) || format('check-detekt-{0}', github.ref) }}
|
||||
@@ -252,7 +255,7 @@ jobs:
|
||||
|
||||
ktlint:
|
||||
name: Ktlint checks
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ github.ref == 'refs/heads/main' && format('check-ktlint-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-ktlint-develop-{0}', github.sha) || format('check-ktlint-{0}', github.ref) }}
|
||||
|
||||
@@ -23,11 +23,14 @@ jobs:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
name: Record screenshots on branch ${{ github.event.pull_request.head.ref || github.ref_name }}
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Record-Screenshots'
|
||||
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
@@ -22,13 +22,16 @@ env:
|
||||
jobs:
|
||||
sonar:
|
||||
name: Sonar Quality Checks
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
group: ${{ format('sonar-{0}', github.ref) }}
|
||||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
@@ -21,7 +21,7 @@ env:
|
||||
jobs:
|
||||
tests:
|
||||
name: Runs unit tests
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, Linux, X64]
|
||||
|
||||
# Allow all jobs on main and develop. Just one per PR.
|
||||
concurrency:
|
||||
@@ -29,6 +29,9 @@ jobs:
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
# Only meaningful on GitHub's throwaway VMs. On a persistent self-hosted runner this
|
||||
# would delete dotnet/haskell/docker images from the host on every run.
|
||||
if: runner.environment == 'github-hosted'
|
||||
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
|
||||
with:
|
||||
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
|
||||
|
||||
Reference in New Issue
Block a user