Skip to content

Commit

Permalink
Try using Force CI run label
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinesp committed Jan 2, 2024
1 parent 1d7e8bf commit e4a7bf1
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: APK Build
on:
workflow_dispatch:
pull_request:
types: [ synchronize, labeled ]
merge_group:
push:
branches: [ develop ]
Expand All @@ -17,7 +18,7 @@ jobs:
name: Build APKs
runs-on: ubuntu-latest
# Skip for `main`
if: github.ref != 'refs/heads/main'
if: github.ref != 'refs/heads/main' || github.event.label.name == 'Force CI run'
strategy:
matrix:
variant: [debug, release, nightly, samples]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Danger CI

on: [pull_request, merge_group]
on:
pull_request:
types: [ synchronize, labeled ]

jobs:
build:
runs-on: ubuntu-latest
name: Danger main check
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}
steps:
- uses: actions/checkout@v4
- run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Validate Gradle Wrapper"
on:
pull_request:
types: [ synchronize, labeled ]
merge_group:
push:
branches: [ main, develop ]
Expand All @@ -9,6 +10,7 @@ jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}
# No concurrency required, this is a prerequisite to other actions and should run every time.
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/maestro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cancel-in-progress: true
steps:
- name: Remove Run-Maestro label
if: ${{ github.event.label.name == 'Run-Maestro' }}
if: ${{ !github.event.pull_request.fork && github.event.label.name == 'Run-Maestro' }}
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: Run-Maestro
Expand All @@ -35,16 +35,19 @@ jobs:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-java@v4
name: Use JDK 17
if: ${{ !github.event.pull_request.fork }}
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Assemble debug APK
if: ${{ !github.event.pull_request.fork }}
run: ./gradlew :app:assembleDebug $CI_GRADLE_ARG_PROPERTIES
env:
ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }}
ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }}
ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }}
- uses: mobile-dev-inc/[email protected]
if: ${{ !github.event.pull_request.fork }}
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
# Doc says (https://github.com/mobile-dev-inc/action-maestro-cloud#android):
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Code Quality Checks
on:
workflow_dispatch:
pull_request:
types: [ synchronize, labeled ]
merge_group:
push:
branches: [ main, develop ]
Expand All @@ -16,6 +17,7 @@ jobs:
checkScript:
name: Search for forbidden patterns
runs-on: ubuntu-latest
if: github.event.pull_request || github.event.label.name == 'Force CI run'
steps:
- uses: actions/checkout@v4
- name: Run code quality check suite
Expand All @@ -24,6 +26,7 @@ jobs:
check:
name: Project Check Suite
runs-on: ubuntu-latest
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('check-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('check-develop-{0}', github.sha) || format('check-{0}', github.ref) }}
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/recordScreenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Remove Record-Screenshots label
if: github.event.label.name == 'Record-Screenshots'
if: ${{ !github.event.pull_request.fork && github.event.label.name == 'Record-Screenshots' }}
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: Record-Screenshots
Expand Down Expand Up @@ -48,18 +48,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN || secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Add auto-generated commit warning
uses: actions/github-script@v6
env:
IS_GH_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN == '' }}
if: ${{ env.IS_GH_TOKEN && steps.record.conclusion == 'success' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `The screenshots were generated, but due to Github's restrictions the CI can't run automatically and is now blocked.
Please rebase your branch including the new commit or add [an empty commit](https://coderwall.com/p/vkdekq/git-commit-allow-empty) to trigger the CI 🙏.`
})
2 changes: 2 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Sonar
on:
workflow_dispatch:
pull_request:
types: [ synchronize, labeled ]
merge_group:
push:
branches: [ main, develop ]
Expand All @@ -16,6 +17,7 @@ jobs:
sonar:
name: Sonar Quality Checks
runs-on: ubuntu-latest
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}
# Allow all jobs on main and develop. Just one per PR.
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('sonar-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('sonar-develop-{0}', github.sha) || format('sonar-{0}', github.ref) }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Test
on:
workflow_dispatch:
pull_request:
types: [ synchronize, labeled ]
merge_group:
push:
branches: [ main, develop ]
Expand All @@ -16,6 +17,7 @@ jobs:
tests:
name: Runs unit tests
runs-on: ubuntu-latest
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}

# Allow all jobs on main and develop. Just one per PR.
concurrency:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/validate-lfs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Validate Git LFS

on: [pull_request, merge_group]
on:
pull_request:
types: [ synchronize, labeled ]

jobs:
build:
runs-on: ubuntu-latest
name: Validate
if: ${{ !github.event.label.name || github.event.label.name == 'Force CI run' }}
steps:
- uses: nschloe/[email protected]

Expand Down

0 comments on commit e4a7bf1

Please sign in to comment.