Skip to content

Commit 0f9de6c

Browse files
steelrooterfacebook-github-bot
authored andcommitted
Fix GH Actions & CircleCI workflows (#2774)
Summary: Fixes both the workflows Pull Request resolved: #2774 Test Plan: Verified on Github. All workflows are green. Reviewed By: kartavya-ramnani Differential Revision: D58090329 Pulled By: steelrooter fbshipit-source-id: 3917cb1c3265efed217550d30b566b592a0d4704
1 parent b61c447 commit 0f9de6c

File tree

4 files changed

+49
-24
lines changed

4 files changed

+49
-24
lines changed

.circleci/config.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
#
66
version: 2.1
77
orbs:
8-
android: circleci/android@2.2.0
8+
android: circleci/android@2.5.0
99

1010
commands:
1111
run-tests:
1212
steps:
1313
- run:
1414
name: Run Tests
15-
command: ./gradlew test assembleDebug -PdisablePreDex
15+
command: |
16+
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
17+
./gradlew test assembleDebug -PdisablePreDex --info
1618
run-instrumentation-tests:
1719
steps:
1820
- run:
@@ -26,6 +28,28 @@ commands:
2628
command: |
2729
mkdir -p /home/circleci/test-results/junit
2830
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} /home/circleci/test-results/junit \;
31+
setup-jdk-17:
32+
steps:
33+
- run:
34+
name: Install OpenJDK 17
35+
command: |
36+
sudo apt-get update && sudo apt-get install openjdk-17-jdk
37+
sudo update-alternatives --set java /usr/lib/jvm/java-17-openjdk-amd64/bin/java
38+
sudo update-alternatives --set javac /usr/lib/jvm/java-17-openjdk-amd64/bin/javac
39+
java -version
40+
echo "Previous JAVA_HOME:"
41+
echo $JAVA_HOME
42+
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
43+
echo "New JAVA_HOME:"
44+
echo $JAVA_HOME
45+
print-debug-info:
46+
steps:
47+
- run:
48+
name: Print debug info
49+
command: |
50+
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
51+
echo "Printing Gradle Wrapper version"
52+
./gradlew --version
2953
3054
jobs:
3155
build:
@@ -37,18 +61,11 @@ jobs:
3761
resource-class: large
3862
steps:
3963
- checkout
64+
- setup-jdk-17
4065
- android/accept-licenses
4166
- android/restore-gradle-cache:
4267
cache-prefix: v1a
43-
- android/create-avd:
44-
avd-name: testAVD
45-
install: true
46-
system-image: system-images;android-29;default;x86
47-
- android/start-emulator:
48-
avd-name: testAVD
49-
no-window: true
50-
restore-gradle-cache-prefix: v1a
51-
- android/wait-for-emulator
68+
- print-debug-info
5269
- run-tests
5370
- android/save-gradle-cache:
5471
cache-prefix: v1a

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
push:
44
branches:
55
- main
6+
pull_request:
7+
branches:
8+
- main
69
jobs:
710
build:
811
runs-on: ubuntu-latest
@@ -23,8 +26,8 @@ jobs:
2326
run: ./gradlew test assembleDebug -PdisablePreDex
2427
- name: Copy Results
2528
run: |
26-
mkdir -p /home/gh_actions/test-results/junit
27-
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} /home/gh_actions/test-results/junit \;
29+
mkdir -p ./gh_actions/test-results/junit
30+
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ./gh_actions/test-results/junit \;
2831
- uses: actions/upload-artifact@v4.0.0
2932
with:
30-
path: "/home/gh_actions/test-results"
33+
path: "./gh_actions/test-results"

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ jobs:
66
name: "Validation"
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: gradle/wrapper-validation-action@v1
9+
- uses: actions/checkout@v4
10+
- uses: gradle/actions/wrapper-validation@v3

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,23 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
20-
- name: set up JDK
21-
uses: actions/setup-java@v1
19+
- uses: actions/checkout@v4
20+
- name: Install JDK
21+
uses: actions/setup-java@v4
2222
with:
23-
java-version: 11
24-
distribution: 'zulu'
23+
distribution: 'temurin'
24+
java-version: |
25+
11
26+
17
27+
cache: gradle
2528
- name: Setup Android SDK
26-
uses: android-actions/setup-android@v2
29+
uses: android-actions/setup-android@v3
2730
- name: Install NDK
28-
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;25.0.8775105" --sdk_root=${ANDROID_SDK_ROOT}
31+
- uses: nttld/setup-ndk@v1
32+
with:
33+
ndk-version: r25c
2934
- name: Register NDK
30-
run: "echo 'ndk.path=/usr/local/lib/android/sdk/ndk/25.0.8775105/' >> local.properties"
35+
run: "echo 'ndk.path=/usr/local/lib/android/sdk/ndk/25.2.9519653' >> local.properties"
3136
- name: Write GPG Sec Ring
3237
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
3338
- name: Update gradle.properties

0 commit comments

Comments
 (0)