aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/checks.yml
blob: ce7ac93f95bb2f1866ff6014c7fcadcc924cd7ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: checks

on:
  push:
    branches:
      - master
      - release-branch-v*
    paths-ignore:
      - '**.md'
  pull_request:
    branches:
      - '*'
    paths-ignore:
      - '**.md'

env:
  TERM: dumb
  GRADLE_OPTS: "-Dorg.gradle.daemon=false --stacktrace"
  GRADLE_USER_HOME: ".github_cache_gradle/"
  TMPDIR: "/tmp"

jobs:
  setup:
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    steps:
      - uses: actions/checkout@v2
      - name: setup
        run: |
          echo "ENV:"
          printenv
          echo "******"
          echo "Event: "
          cat ${GITHUB_EVENT_PATH}
          echo "***"
          ./scripts/ci/ci_setup.sh

  checks:
    needs: [setup]
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: .github_cache_gradle/
          key: checks-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('buildSrc/**/*.java') }}
          restore-keys: |
            checks-gradle-
      - name: check
        run: ./scripts/ci/ci_check.sh
      - uses: ./.github/actions/collect-reports
        if: always()
        with:
          file_pattern: checkstyle*.html
      - uses: ./.github/actions/collect-reports
        if: always()
        with:
          file_pattern: lint-results-*.html
      - uses: actions/upload-artifact@v1.0.0
        if: always()
        with:
          name: checks-reports
          path: collected_reports

  app-tests-shards:
    needs: [setup]
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    strategy:
      matrix:
        index: [0, 1]
        groups_count: [2]
      fail-fast: false
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: .github_cache_gradle/
          key: tests-shards-gradle-${{ matrix.index }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('buildSrc/**/*.java') }}
          restore-keys: |
            tests-shards-gradle-
      - name: tests
        uses: ./.github/actions/test-shard-run
        with:
          index: ${{ matrix.index }}
          groups_count: ${{ matrix.groups_count }}
          module: ":ime:app:"
          extra_args: "-PexcludeTestClasses=\"**/*AllSdkTest*\""
      - uses: ./.github/actions/collect-reports
        if: always()
        with:
          file_pattern: "**/build/reports/tests/**/*"
      - uses: actions/upload-artifact@v1.0.0
        if: always()
        with:
          name: app-tests_${{ matrix.index }}
          path: collected_reports

  app-all-sdks-tests:
    needs: [setup]
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: .github_cache_gradle/
          key: tests-all-sdks-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('buildSrc/**/*.java') }}
          restore-keys: |
            tests-all-sdks-gradle-
      - name: tests
        uses: ./.github/actions/test-shard-run
        with:
          index: 0
          groups_count: 1
          module: ":ime:app:"
          extra_args: "--tests=*AllSdkTest*"
      - uses: ./.github/actions/collect-reports
        if: always()
        with:
          file_pattern: "**/build/reports/tests/**/*"
      - uses: actions/upload-artifact@v1.0.0
        if: always()
        with:
          name: app-less-tests
          path: collected_reports

  app-less-tests:
    needs: [setup]
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: .github_cache_gradle/
          key: tests-app-less-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('buildSrc/**/*.java') }}
          restore-keys: |
            tests-app-less-gradle-
      - name: tests
        uses: ./.github/actions/test-shard-run
        with:
          index: 0
          groups_count: 1
          module: ""
          extra_args: "-x :ime:app:testDebugUnitTest -x :ime:app:testDebugUnitTestCoverage"
      - uses: ./.github/actions/collect-reports
        if: always()
        with:
          file_pattern: "**/build/reports/tests/**/*"
      - uses: actions/upload-artifact@v1.0.0
        if: always()
        with:
          name: app-less-tests
          path: collected_reports

  deploy-dry-run:
    if: github.event_name == 'pull_request'
    needs: [setup]
    runs-on: ubuntu-18.04
    container: menny/ndk_ask:1.13.1
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v1
        with:
          path: .github_cache_gradle/
          key: dry-run-deploy-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('buildSrc/**/*.java') }}
          restore-keys: |
            dry-run-deploy-gradle-
      - name: deploy
        uses: ./.github/actions/deploy
        with:
          deploy_tasks: "-DdeployChannel=alpha assembleRelease assembleCanary verifyReleaseResources generateReleasePlayResources generateCanaryPlayResources :generateFdroidYamls"
      - uses: actions/upload-artifact@v1.0.0
        with:
          name: fdroid-metadata-dry-run
          path: outputs/fdroid