Start Adding GitHub Actions (#1165)

Summary:
This change starts adding more coverage to GitHub Actions. Existing workflows are split up to be per-platform, and stale scripts, etc are removed.

We are currently limited a bit by issues with the build itself, but this still adds a good bit of coverage that readily works, and adds places to inject more.

Another option would have been to move these to CircleCI where we have more credits, or used docker images instead of manual setup steps. etc, The Yoga build and number of changes is very light though, so we don't really need the complexity yet.

Some TODOs:
1. Fix the Apple Builds (pod lint and pod install return errors seen by the community)
2. Add working Android UTs
3. Add C++ UTs
4. Add Apple Publish
5. Add version stamping

Changelog:
[Internal][Added] - Start Adding Yoga GitHub Actions

Pull Request resolved: https://github.com/facebook/yoga/pull/1165

Reviewed By: cortinico

Differential Revision: D40386426

Pulled By: NickGerleman

fbshipit-source-id: c540dd25bfec6ac8c05e461c1236ef7fe6cb8598
This commit is contained in:
Nick Gerleman
2022-10-17 23:35:01 -07:00
committed by Facebook GitHub Bot
parent c2a0ccf0d4
commit e9184c793e
22 changed files with 349 additions and 272 deletions

View File

@@ -1,56 +0,0 @@
#!/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.
set -e
function download() {
if hash curl 2>/dev/null; then
curl -s -L -o "$2" "$1"
elif hash wget 2>/dev/null; then
wget -O "$2" "$1"
else
echo >&2 "No supported download tool installed. Please get either wget or curl."
exit
fi
}
function installsdk() {
PROXY_ARGS=""
if [[ ! -z "$HTTPS_PROXY" ]]; then
PROXY_HOST="$(echo $HTTPS_PROXY | cut -d : -f 1,1)"
PROXY_PORT="$(echo $HTTPS_PROXY | cut -d : -f 2,2)"
PROXY_ARGS="--proxy=http --proxy_host=$PROXY_HOST --proxy_port=$PROXY_PORT"
fi
echo y | "$ANDROID_HOME"/tools/bin/sdkmanager $PROXY_ARGS "$@"
}
function installAndroidSDK {
if [[ ! -d "$HOME/android-sdk" ]]; then
TMP=/tmp/sdk$$.zip
download 'https://dl.google.com/android/repository/tools_r25.2.3-linux.zip' $TMP
unzip -qod "$HOME/android-sdk" $TMP
rm $TMP
fi
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
if [[ ! -d "$ANDROID_NDK_REPOSITORY/android-ndk-r15c" ]]; then
TMP=/tmp/ndk$$.zip
mkdir -p "$ANDROID_NDK_REPOSITORY"
download 'https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip' $TMP
unzip -qod "$ANDROID_NDK_REPOSITORY" "$TMP"
rm $TMP
fi
export ANDROID_HOME=$HOME/android-sdk
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
mkdir -p $ANDROID_HOME/licenses/
echo > $ANDROID_HOME/licenses/android-sdk-license
echo -n d56f5187479451eabf01fb78af6dfcb131a6481e > $ANDROID_HOME/licenses/android-sdk-license
installsdk 'build-tools;25.0.3' 'build-tools;26.0.2' 'platforms;android-25' 'platforms;android-26' 'ndk-bundle' 'extras;android;m2repository' 'cmake;3.6.4111459'
}

View File

@@ -1,44 +0,0 @@
#!/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.
set -e
ROOTDIR="$(dirname $0)/.."
echo -e "\033[1;34m** We can deploy two libraries\n** (1) Java bindings to Yoga\n** (2) Android YogaLayout\n** Which do you want to ship today? \033[0m"
read -p "" -n 1 mod
case $mod in
1 ) MODULE="yoga";;
2 ) MODULE="yoga-layout";;
* ) echo -e "\n\033[1;34m** Invalid selection" && exit
esac
echo -e "\n\033[1;34m** We'll need your Bintray credentials. If you don't remember them go to https://bintray.com/profile/edit\033[0m"
echo -e "\033[1;34m** [1/3] Please enter your Bintray username (probably not your email address): \033[0m"
read -r BINTRAY_USER
echo -e "\033[1;34m** [2/3] Please enter your Bintray API key: \033[0m"
read -r BINTRAY_KEY
echo -e "\033[1;34m** [3/3] Please enter your GPG passphrase: \033[0m"
read -r GPG_PASS
uploadcmd="$ROOTDIR/gradlew clean :${MODULE}:build bintrayUpload --info -PbintrayUsername='$BINTRAY_USER' -PbintrayApiKey='$BINTRAY_KEY' -PbintrayGpgPassword='$GPG_PASS'"
echo
echo -e "\033[1;34m** Dry run\033[0m"
eval "$uploadcmd -PdryRun=true"
echo
echo -e "\033[1;34m** Are you happy to conintue?: [yN]\033[0m"
read -p "" -n 1 yn
case $yn in
[Yy]* ) ;;
* ) echo -e "\n\033[1;34m** Run $0 when you're ready to try again\033[0m" && exit;;
esac
echo
echo -e "\033[1;34m** Publishing\033[0m"
eval "$uploadcmd"

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
#
# Deploy a SNAPSHOT JAR after every successful CI run To Sonatype.
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
set -e
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
IS_SNAPSHOT="$(grep 'VERSION_NAME=[0-9\.]\+-SNAPSHOT' "$BASEDIR/gradle.properties")"
if [ "$IS_SNAPSHOT" == "" ]; then
echo >&2 "Skipping build. Given build doesn't appear to be a SNAPSHOT release."
else
env TERMINAL=dumb "$BASEDIR/gradlew" publish
fi

View File

@@ -1 +0,0 @@
k<EFBFBD><EFBFBD><EFBFBD><04><18>=+\M<><4D>n<EFBFBD>mq6<71>P<16><>q<EFBFBD>Z<<3C>c%<25><><1D>j<EFBFBD><6A><EFBFBD>d<EFBFBD><64><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><11>9C7P`]<5D><><EFBFBD><EFBFBD>#<23>Z<EFBFBD>+<2B><><EFBFBD><EFBFBD><EFBFBD>^ 7<><37><EFBFBD><EFBFBD><EFBFBD>*<2A><><EFBFBD>r<EFBFBD>`L<>A<13>1m<31><6D><EFBFBD>0h<30>n% v<><76>