Skip to content

Commit

Permalink
Simplify CI setup with a common script (#2775)
Browse files Browse the repository at this point in the history
Summary:
Simplifies CI setup by making all CIs use a common script to trigger the build.

Pull Request resolved: #2775

Test Plan: Verified on Github and CircleCI. Sandcastle is also green.

Reviewed By: oprisnik

Differential Revision: D58133180

Pulled By: steelrooter

fbshipit-source-id: 914a11740d03eb4a5c2746192330ffab5c1cc97b
  • Loading branch information
steelrooter authored and facebook-github-bot committed Jun 4, 2024
1 parent 0f9de6c commit 773f08c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ commands:
name: Run Tests
command: |
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
./gradlew test assembleDebug -PdisablePreDex --info
./ci/build-and-test.sh
run-instrumentation-tests:
steps:
- run:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ jobs:
11
17
cache: gradle
- name: Print debug info
run: |
echo "Printing env PATH var"
echo $PATH
echo "Printing Gradle Wrapper version"
./gradlew --version
- name: Build & run tests
run: ./gradlew test assembleDebug -PdisablePreDex
run: ./ci/build-and-test.sh
- name: Copy Results
run: |
mkdir -p ./gh_actions/test-results/junit
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ./gh_actions/test-results/junit \;
- uses: actions/upload-artifact@v4.0.0
- uses: actions/upload-artifact@v4
with:
path: "./gh_actions/test-results"
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install JDK
Expand All @@ -28,11 +26,13 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install NDK
- uses: nttld/setup-ndk@v1
uses: nttld/setup-ndk@v1
with:
ndk-version: r25c
- name: Register NDK
run: "echo 'ndk.path=/usr/local/lib/android/sdk/ndk/25.2.9519653' >> local.properties"
run: |
echo $PATH
echo 'ndk.path=/opt/hostedtoolcache/ndk/r25c/x64' >> local.properties
- name: Write GPG Sec Ring
run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg
- name: Update gradle.properties
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<img alt="Fresco Logo" align="right" src="docs/static/sample-images/fresco_logo.svg" width="15%" />

![Build Status](https://github.com/facebook/fresco/actions/workflows/build.yml/badge.svg?event=push)
[![Build Status](https://circleci.com/gh/facebook/fresco.svg?style=shield)](https://circleci.com/gh/facebook/fresco)
[![License](https://img.shields.io/badge/license-MIT-brightgreen)](https://github.com/facebook/fresco/blob/main/LICENSE)

Expand Down
7 changes: 7 additions & 0 deletions ci/build-and-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

./gradlew test assembleDebug assembleDebugAndroidTest -PdisablePreDex --info

0 comments on commit 773f08c

Please sign in to comment.