|
3 | 3 | # Copyright (c) 2021 Vilius Sutkus <ViliusSutkus89@gmail.com> |
4 | 4 | # |
5 | 5 | # https://github.com/ViliusSutkus89/Sample_Android_Library-MavenCentral-Instrumented_Tests |
6 | | -# .github/workflows/privilegedBuild.yml - v1.2.0 |
| 6 | +# .github/workflows/privilegedBuild.yml - v1.4.0 |
7 | 7 | # |
8 | 8 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
9 | 9 | # of this software and associated documentation files (the "Software"), to deal |
@@ -52,6 +52,7 @@ permissions: |
52 | 52 |
|
53 | 53 | jobs: |
54 | 54 | buildDependencies: |
| 55 | + if: "!contains(github.event.head_commit.message, '[SkipCI]') && !contains(github.event.head_commit.message, '[AppOnly]')" |
55 | 56 | runs-on: ubuntu-20.04 |
56 | 57 | strategy: |
57 | 58 | fail-fast: false |
@@ -203,37 +204,6 @@ jobs: |
203 | 204 | path: maven-local.tar |
204 | 205 | if-no-files-found: error |
205 | 206 |
|
206 | | - buildApplicationStaging: |
207 | | - needs: buildLibrary |
208 | | - runs-on: ubuntu-20.04 |
209 | | - steps: |
210 | | - - uses: actions/checkout@v2 |
211 | | - - uses: actions/setup-java@v2 |
212 | | - with: |
213 | | - distribution: zulu |
214 | | - java-version: 11 |
215 | | - - uses: android-actions/setup-android@v2 |
216 | | - |
217 | | - - name: Prepare application for staging repository |
218 | | - run: ./ci-scripts/prepareSampleAppForStagingRepository application app --output=build/application-staging --repository=${{ needs.buildLibrary.outputs.STAGING_REPO_URL }} |
219 | | - |
220 | | - - name: Build and lint application from staging library |
221 | | - run: ./gradlew build lintRelease |
222 | | - working-directory: build/application-staging |
223 | | - |
224 | | - - uses: actions/upload-artifact@v2 |
225 | | - with: |
226 | | - name: application-staging-apks |
227 | | - path: build/application-staging/app/build/outputs/apk/**/*.apk |
228 | | - if-no-files-found: error |
229 | | - |
230 | | - - run: mv build/application-staging/app/build/reports/lint-results-release.html application-staging-lint-report.html |
231 | | - - uses: actions/upload-artifact@v2 |
232 | | - with: |
233 | | - name: application-staging-lint-report.html |
234 | | - path: application-staging-lint-report.html |
235 | | - if-no-files-found: error |
236 | | - |
237 | 207 | runInstrumentedTests: |
238 | 208 | needs: buildLibrary |
239 | 209 | # Only macos VMs are available with exposed CPU extensions to run hardware accelerated emulator |
@@ -284,3 +254,62 @@ jobs: |
284 | 254 | name: instrumentedTestsReport-${{ matrix.api-level }}-${{ matrix.arch }}.tar |
285 | 255 | path: instrumentedTestsReport-${{ matrix.api-level }}-${{ matrix.arch }}.tar |
286 | 256 | if-no-files-found: error |
| 257 | + |
| 258 | + buildApplicationAgainstUnReleasedLibrary: |
| 259 | + needs: buildLibrary |
| 260 | + runs-on: ubuntu-20.04 |
| 261 | + steps: |
| 262 | + - uses: actions/checkout@v2 |
| 263 | + - uses: actions/setup-java@v2 |
| 264 | + with: |
| 265 | + distribution: zulu |
| 266 | + java-version: 11 |
| 267 | + - uses: android-actions/setup-android@v2 |
| 268 | + |
| 269 | + - name: Prepare application for staging repository |
| 270 | + run: ./ci-scripts/prepareSampleAppForStagingRepository application app --output=build/application-staging --repository=${{ needs.buildLibrary.outputs.STAGING_REPO_URL }} |
| 271 | + |
| 272 | + - name: Build and lint application from staging library |
| 273 | + run: ./gradlew build lintRelease |
| 274 | + working-directory: build/application-staging |
| 275 | + |
| 276 | + - uses: actions/upload-artifact@v2 |
| 277 | + with: |
| 278 | + name: application-staging-apks |
| 279 | + path: build/application-staging/app/build/outputs/apk/**/*.apk |
| 280 | + if-no-files-found: error |
| 281 | + |
| 282 | + - run: mv build/application-staging/app/build/reports/lint-results-release.html application-staging-lint-report.html |
| 283 | + - uses: actions/upload-artifact@v2 |
| 284 | + with: |
| 285 | + name: application-staging-lint-report.html |
| 286 | + path: application-staging-lint-report.html |
| 287 | + if-no-files-found: error |
| 288 | + |
| 289 | + buildApplicationAgainstReleasedLibrary: |
| 290 | + if: "!contains(github.event.head_commit.message, '[SkipCI]') && contains(github.event.head_commit.message, '[AppOnly]')" |
| 291 | + runs-on: ubuntu-20.04 |
| 292 | + steps: |
| 293 | + - uses: actions/checkout@v2 |
| 294 | + - uses: actions/setup-java@v2 |
| 295 | + with: |
| 296 | + distribution: zulu |
| 297 | + java-version: 11 |
| 298 | + - uses: android-actions/setup-android@v2 |
| 299 | + |
| 300 | + - name: Build and lint application |
| 301 | + run: ./gradlew build lintRelease |
| 302 | + working-directory: application |
| 303 | + |
| 304 | + - uses: actions/upload-artifact@v2 |
| 305 | + with: |
| 306 | + name: application-staging-apks |
| 307 | + path: build/application-staging/app/build/outputs/apk/**/*.apk |
| 308 | + if-no-files-found: error |
| 309 | + |
| 310 | + - run: mv application/app/build/reports/lint-results-release.html application-lint-report.html |
| 311 | + - uses: actions/upload-artifact@v2 |
| 312 | + with: |
| 313 | + name: application-lint-report.html |
| 314 | + path: application-lint-report.html |
| 315 | + if-no-files-found: error |
0 commit comments