diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af67604b3c..ece6d4b005 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/build_enterprise.yml b/.github/workflows/build_enterprise.yml index 4f447aafab..3e22cee30e 100644 --- a/.github/workflows/build_enterprise.yml +++ b/.github/workflows/build_enterprise.yml @@ -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 diff --git a/.github/workflows/maestro-local.yml b/.github/workflows/maestro-local.yml index f28e9951be..ec48715155 100644 --- a/.github/workflows/maestro-local.yml +++ b/.github/workflows/maestro-local.yml @@ -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 diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 22bfb72f61..d8ba6e252e 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -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) }} diff --git a/.github/workflows/recordScreenshots.yml b/.github/workflows/recordScreenshots.yml index 811b613088..f1426fb279 100644 --- a/.github/workflows/recordScreenshots.yml +++ b/.github/workflows/recordScreenshots.yml @@ -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 diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 05600a524d..fc575ed5de 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 60032d50fb..02d03880c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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