|
6 | 6 | pull_request: |
7 | 7 | branches: [ "develop" ] |
8 | 8 |
|
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
9 | 13 | jobs: |
| 14 | + setup: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up local.properties |
| 21 | + run: echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties |
| 22 | + |
| 23 | + - name: Set up keystore |
| 24 | + run: | |
| 25 | + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/ndgl.keystore |
| 26 | + echo "KEYSTORE_PATH=../app/ndgl.keystore" >> local.properties |
| 27 | + echo "KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}" >> local.properties |
| 28 | + echo "KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}" >> local.properties |
| 29 | + echo "KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> local.properties |
| 30 | + echo "NDGL_BASE_URL_DEBUG=${{ secrets.NDGL_BASE_URL_DEBUG }}" >> local.properties |
| 31 | + echo "NDGL_BASE_URL_RELEASE=${{ secrets.NDGL_BASE_URL_RELEASE }}" >> local.properties |
| 32 | +
|
| 33 | + - name: Set up google-services.json |
| 34 | + run: | |
| 35 | + echo '${{ secrets.GOOGLE_SERVICES_DEBUG }}' | base64 -d > app/src/debug/google-services.json |
| 36 | + echo '${{ secrets.GOOGLE_SERVICES_RELEASE }}' | base64 -d > app/src/release/google-services.json |
| 37 | +
|
| 38 | + - name: Upload config files |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: config-files |
| 42 | + retention-days: 1 |
| 43 | + path: | |
| 44 | + local.properties |
| 45 | + app/ndgl.keystore |
| 46 | + app/src/debug/google-services.json |
| 47 | + app/src/release/google-services.json |
| 48 | +
|
| 49 | + lint: |
| 50 | + needs: setup |
| 51 | + runs-on: ubuntu-latest |
| 52 | + |
| 53 | + steps: |
| 54 | + - uses: ./.github/actions/ci-setup |
| 55 | + |
| 56 | + - name: Code style checks |
| 57 | + run: ./gradlew ktlintCheck detekt --build-cache --parallel |
| 58 | + |
10 | 59 | build: |
| 60 | + needs: setup |
11 | 61 | runs-on: ubuntu-latest |
12 | 62 |
|
13 | 63 | steps: |
14 | | - - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: Setup Gradle |
17 | | - uses: gradle/actions/setup-gradle@v4 |
18 | | - with: |
19 | | - gradle-home-cache-cleanup: true |
20 | | - |
21 | | - - name: Set up JDK 21 |
22 | | - uses: actions/setup-java@v4 |
23 | | - with: |
24 | | - java-version: '21' |
25 | | - distribution: 'temurin' |
26 | | - |
27 | | - - name: Grant execute permission for gradlew |
28 | | - run: chmod +x gradlew |
29 | | - |
30 | | - - name: Set up local.properties |
31 | | - run: echo "${{ secrets.LOCAL_PROPERTIES }}" > local.properties |
32 | | - |
33 | | - - name: Set up keystore |
34 | | - run: | |
35 | | - echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > app/ndgl.keystore |
36 | | - echo "KEYSTORE_PATH=../app/ndgl.keystore" >> local.properties |
37 | | - echo "KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}" >> local.properties |
38 | | - echo "KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}" >> local.properties |
39 | | - echo "KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> local.properties |
40 | | - echo "NDGL_BASE_URL_DEBUG=${{ secrets.NDGL_BASE_URL_DEBUG }}" >> local.properties |
41 | | - echo "NDGL_BASE_URL_RELEASE=${{ secrets.NDGL_BASE_URL_RELEASE }}" >> local.properties |
42 | | -
|
43 | | - - name: Set up google-services.json |
44 | | - run: | |
45 | | - echo '${{ secrets.GOOGLE_SERVICES_DEBUG }}' | base64 -d > app/src/debug/google-services.json |
46 | | - echo '${{ secrets.GOOGLE_SERVICES_RELEASE }}' | base64 -d > app/src/release/google-services.json |
47 | | -
|
48 | | - - name: Code style checks |
49 | | - run: ./gradlew ktlintCheck detekt |
50 | | - |
51 | | - - name: Run build |
52 | | - run: ./gradlew assembleDebug --stacktrace |
| 64 | + - uses: ./.github/actions/ci-setup |
| 65 | + |
| 66 | + - name: Run build |
| 67 | + run: ./gradlew assembleDebug --build-cache --parallel --stacktrace |
0 commit comments