Skip to content

Commit dcc400d

Browse files
authoredAug 27, 2020
Merge pull request android#123 from android/cb/actions
[CI] Sets up a workflow per project
2 parents 10bc1c1 + feb864d commit dcc400d

File tree

10 files changed

+617
-71
lines changed

10 files changed

+617
-71
lines changed
 

Diff for: ‎.github/workflows/Crane.yaml

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Crane
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Crane/**'
9+
pull_request:
10+
paths:
11+
- 'Crane/**'
12+
13+
env:
14+
SAMPLE_PATH: Crane
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports
60+
61+
test:
62+
needs: build
63+
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
64+
timeout-minutes: 30
65+
strategy:
66+
matrix:
67+
api-level: [23, 26, 29]
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v2
72+
73+
- name: Copy CI gradle.properties
74+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
75+
76+
- name: Set up JDK 1.8
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: 1.8
80+
81+
- name: Generate cache key
82+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
83+
84+
- uses: actions/cache@v2
85+
with:
86+
path: |
87+
~/.gradle/caches/modules-2
88+
~/.gradle/caches/jars-3
89+
~/.gradle/caches/build-cache-1
90+
key: gradle-${{ hashFiles('checksum.txt') }}
91+
92+
- name: Run instrumentation tests
93+
uses: reactivecircus/android-emulator-runner@v2
94+
with:
95+
api-level: ${{ matrix.api-level }}
96+
target: google_apis
97+
arch: x86
98+
disable-animations: true
99+
script: ./gradlew connectedCheck --stacktrace
100+
working-directory: ${{ env.SAMPLE_PATH }}
101+
102+
- name: Upload test reports
103+
if: always()
104+
uses: actions/upload-artifact@v2
105+
with:
106+
name: test-reports
107+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/JetNews.yaml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: JetNews
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'JetNews/**'
9+
pull_request:
10+
paths:
11+
- 'JetNews/**'
12+
13+
env:
14+
SAMPLE_PATH: JetNews
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports
60+
61+
test:
62+
needs: build
63+
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
64+
timeout-minutes: 30
65+
strategy:
66+
matrix:
67+
api-level: [23, 26, 29]
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v2
72+
73+
- name: Copy CI gradle.properties
74+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
75+
76+
- name: Set up JDK 1.8
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: 1.8
80+
81+
- name: Generate cache key
82+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
83+
84+
- uses: actions/cache@v2
85+
with:
86+
path: |
87+
~/.gradle/caches/modules-2
88+
~/.gradle/caches/jars-3
89+
~/.gradle/caches/build-cache-1
90+
key: gradle-${{ hashFiles('checksum.txt') }}
91+
92+
- name: Run instrumentation tests
93+
uses: reactivecircus/android-emulator-runner@v2
94+
with:
95+
api-level: ${{ matrix.api-level }}
96+
arch: x86
97+
disable-animations: true
98+
script: ./gradlew connectedCheck --stacktrace
99+
working-directory: ${{ env.SAMPLE_PATH }}
100+
101+
- name: Upload test reports
102+
if: always()
103+
uses: actions/upload-artifact@v2
104+
with:
105+
name: test-reports
106+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Jetcaster.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Jetcaster
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Jetcaster/**'
9+
pull_request:
10+
paths:
11+
- 'Jetcaster/**'
12+
13+
env:
14+
SAMPLE_PATH: Jetcaster
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Jetchat.yaml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Jetchat
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Jetchat/**'
9+
pull_request:
10+
paths:
11+
- 'Jetchat/**'
12+
13+
env:
14+
SAMPLE_PATH: Jetchat
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports
60+
61+
test:
62+
needs: build
63+
runs-on: macOS-latest # enables hardware acceleration in the virtual machine
64+
timeout-minutes: 30
65+
strategy:
66+
matrix:
67+
api-level: [23, 26, 29]
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v2
72+
73+
- name: Copy CI gradle.properties
74+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
75+
76+
- name: Set up JDK 1.8
77+
uses: actions/setup-java@v1
78+
with:
79+
java-version: 1.8
80+
81+
- name: Generate cache key
82+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
83+
84+
- uses: actions/cache@v2
85+
with:
86+
path: |
87+
~/.gradle/caches/modules-2
88+
~/.gradle/caches/jars-3
89+
~/.gradle/caches/build-cache-1
90+
key: gradle-${{ hashFiles('checksum.txt') }}
91+
92+
- name: Run instrumentation tests
93+
uses: reactivecircus/android-emulator-runner@v2
94+
with:
95+
api-level: ${{ matrix.api-level }}
96+
arch: x86
97+
disable-animations: true
98+
script: ./gradlew connectedCheck --stacktrace
99+
working-directory: ${{ env.SAMPLE_PATH }}
100+
101+
- name: Upload test reports
102+
if: always()
103+
uses: actions/upload-artifact@v2
104+
with:
105+
name: test-reports
106+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Jetsnack.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Jetsnack
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Jetsnack/**'
9+
pull_request:
10+
paths:
11+
- 'Jetsnack/**'
12+
13+
env:
14+
SAMPLE_PATH: Jetsnack
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Jetsurvey.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Jetsurvey
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Jetsurvey/**'
9+
pull_request:
10+
paths:
11+
- 'Jetsurvey/**'
12+
13+
env:
14+
SAMPLE_PATH: Jetsurvey
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Owl.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Owl
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Owl/**'
9+
pull_request:
10+
paths:
11+
- 'Owl/**'
12+
13+
env:
14+
SAMPLE_PATH: Owl
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/Rally.yaml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Rally
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- 'Rally/**'
9+
pull_request:
10+
paths:
11+
- 'Rally/**'
12+
13+
env:
14+
SAMPLE_PATH: Rally
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Copy CI gradle.properties
26+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
27+
28+
- name: Set up JDK 1.8
29+
uses: actions/setup-java@v1
30+
with:
31+
java-version: 1.8
32+
33+
- name: Generate cache key
34+
run: ./scripts/checksum.sh $SAMPLE_PATH checksum.txt
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: |
39+
~/.gradle/caches/modules-2
40+
~/.gradle/caches/jars-3
41+
~/.gradle/caches/build-cache-1
42+
key: gradle-${{ hashFiles('checksum.txt') }}
43+
44+
- name: Build project
45+
working-directory: ${{ env.SAMPLE_PATH }}
46+
run: ./gradlew spotlessCheck assembleDebug lintDebug --stacktrace
47+
48+
- name: Upload build outputs (APKs)
49+
uses: actions/upload-artifact@v2
50+
with:
51+
name: build-outputs
52+
path: ${{ env.SAMPLE_PATH }}/app/build/outputs
53+
54+
- name: Upload build reports
55+
if: always()
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: build-reports
59+
path: ${{ env.SAMPLE_PATH }}/app/build/reports

Diff for: ‎.github/workflows/ci.yaml

-69
This file was deleted.

Diff for: ‎JetNews/checksum.sh renamed to ‎scripts/checksum.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#
1616

1717
#!/bin/bash
18-
RESULT_FILE=$1
18+
SAMPLE=$1
19+
RESULT_FILE=$2
1920

2021
if [ -f $RESULT_FILE ]; then
2122
rm $RESULT_FILE
@@ -29,7 +30,7 @@ checksum_file() {
2930
FILES=()
3031
while read -r -d ''; do
3132
FILES+=("$REPLY")
32-
done < <(find . -type f \( -name "build.gradle*" -o -name "gradle-wrapper.properties" \) -print0)
33+
done < <(find $SAMPLE -type f \( -name "build.gradle*" -o -name "gradle-wrapper.properties" \) -print0)
3334

3435
# Loop through files and append MD5 to result file
3536
for FILE in ${FILES[@]}; do

0 commit comments

Comments
 (0)
Please sign in to comment.