Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Skip compile job when not on main branch #978

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/test-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ concurrency:

jobs:
compile:
name: Compile and cache
name: Compile for build cache
if: ${{ github.ref == 'refs/heads/main-ose' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -23,14 +24,14 @@ jobs:
- uses: gradle/actions/setup-gradle@v3 # creates build cache when on main branch
with:
cache-encryption-key: ${{ secrets.gradle_encryption_key }}
cache-write-only: ${{ github.ref == 'refs/heads/main-ose' }}
dependency-graph: generate-and-submit # submit Github Dependency Graph info
dependency-graph-continue-on-failure: false

- run: ./gradlew --build-cache --configuration-cache --configuration-cache-problems=warn app:assembleDebug

test:
needs: compile
if: ${{ always() }} # even if compile didn't run (because not on main branch)
name: Tests without emulator
runs-on: ubuntu-latest
steps:
Expand All @@ -49,9 +50,9 @@ jobs:
- name: Run unit tests
run: ./gradlew --build-cache --configuration-cache --configuration-cache-problems=warn app:testOseDebugUnitTest

# generates the build caches because it uses more gradle dependencies
test_on_emulator:
needs: compile
if: ${{ always() }} # even if compile didn't run (because not on main branch)
name: Tests with emulator
runs-on: ubuntu-latest
steps:
Expand Down
Loading