tdlight-java-natives/.github/workflows/build.yaml

108 lines
4.3 KiB
YAML
Raw Normal View History

2020-12-26 12:09:32 +01:00
name: Build TDLib
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build:
strategy:
matrix:
2020-12-26 12:20:40 +01:00
include:
2020-12-26 15:42:49 +01:00
- {os: ubuntu-20.04, arch: "linux/386", implementation: "tdlight"}
- {os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlight"}
- {os: ubuntu-20.04, arch: "linux/amd64", implementation: "tdlib"}
- {os: ubuntu-20.04, arch: "linux/arm/v6", implementation: "tdlight"}
- {os: ubuntu-20.04, arch: "linux/arm/v7", implementation: "tdlight"}
- {os: ubuntu-20.04, arch: "linux/ppc64le", implementation: "tdlight"}
- {os: windows-2019, arch: "amd64", implementation: "tdlight"}
- {os: windows-2019, arch: "amd64", implementation: "tdlib"}
- {os: macos-10.15, arch: "amd64", implementation: "tdlight"}
- {os: macos-10.15, arch: "amd64", implementation: "tdlib"}
2020-12-26 12:16:14 +01:00
runs-on: ${{ matrix.os }}
2020-12-26 12:09:32 +01:00
steps:
2020-12-26 12:38:55 +01:00
- name: Install sudo package
2020-12-26 12:42:01 +01:00
if: runner.os == 'Linux'
2020-12-26 12:38:55 +01:00
run: |
(apt-get update || true) 2>/dev/null
(apt-get install -y sudo || true) 2>/dev/null
sudo apt update
- uses: actions/checkout@v2
with:
submodules: "recursive"
2020-12-26 12:44:32 +01:00
- name: Setup ccache variables
2020-12-26 13:53:38 +01:00
shell: bash
2020-12-26 12:44:32 +01:00
run: |
ARCH=${{ matrix.arch }}
SAFE_ARCH=$(echo $ARCH | sed 's/\//\-/g')
echo "CCACHE_SAFE_ARCH=$SAFE_ARCH" >> $GITHUB_ENV
2020-12-26 12:38:55 +01:00
- name: Cache ccache
2020-12-26 12:42:01 +01:00
if: runner.os == 'Linux'
2020-12-26 12:38:55 +01:00
id: cache-ccache
uses: actions/cache@v2
with:
path: ~/.ccache
2020-12-26 12:44:32 +01:00
key: ${{ runner.os }}-${{ env.CCACHE_SAFE_ARCH }}-ccache-all
2020-12-26 12:38:55 +01:00
restore-keys: |
2020-12-26 12:44:32 +01:00
${{ runner.os }}-${{ env.CCACHE_SAFE_ARCH }}-ccache-
2020-12-26 12:16:14 +01:00
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
2020-12-26 12:09:32 +01:00
- name: Setup variables
2020-12-26 12:42:01 +01:00
shell: bash
2020-12-26 12:09:32 +01:00
run: |
# ====== Variables
2020-12-26 12:45:53 +01:00
export REVISION=${{ github.run_number }}
export GH_MATRIX_OS=${{ matrix.os }}
2020-12-26 12:45:53 +01:00
export GH_MATRIX_ARCH=${{ matrix.arch }}
2020-12-26 15:39:42 +01:00
export IMPLEMENTATION_NAME=${{ matrix.implementation }}
2020-12-26 12:36:31 +01:00
source ./github-workflows/setup-variables.sh
2020-12-26 12:36:31 +01:00
2020-12-26 12:09:32 +01:00
echo "REVISION=$REVISION" >> $GITHUB_ENV
2020-12-26 15:39:42 +01:00
echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV
2020-12-26 12:09:32 +01:00
echo "TD_SRC_DIR=$TD_SRC_DIR" >> $GITHUB_ENV
echo "TD_BIN_DIR=$TD_BIN_DIR" >> $GITHUB_ENV
echo "TDNATIVES_BIN_DIR=$TDNATIVES_BIN_DIR" >> $GITHUB_ENV
echo "TDNATIVES_CPP_SRC_DIR=$TDNATIVES_CPP_SRC_DIR" >> $GITHUB_ENV
echo "TDNATIVES_DOCS_BIN_DIR=$TDNATIVES_DOCS_BIN_DIR" >> $GITHUB_ENV
echo "TD_BUILD_DIR=$TD_BUILD_DIR" >> $GITHUB_ENV
echo "TDNATIVES_CPP_BUILD_DIR=$TDNATIVES_CPP_BUILD_DIR" >> $GITHUB_ENV
echo "JAVA_SRC_DIR=$JAVA_SRC_DIR" >> $GITHUB_ENV
echo "TDLIB_SERIALIZER_DIR=$TDLIB_SERIALIZER_DIR" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV
echo "JAVA_INCLUDE_PATH=$JAVA_INCLUDE_PATH" >> $GITHUB_ENV
echo "CMAKE_EXTRA_ARGUMENTS=$CMAKE_EXTRA_ARGUMENTS" >> $GITHUB_ENV
echo "VCPKG_DIR=$VCPKG_DIR" >> $GITHUB_ENV
echo "MAVEN_OPTS=$MAVEN_OPTS" >> $GITHUB_ENV
echo "GH_CPU_ARCH=$GH_CPU_ARCH" >> $GITHUB_ENV
echo "CPU_ARCH_JAVA=$CPU_ARCH_JAVA" >> $GITHUB_ENV
echo "CPU_ARCHITECTURE_NAME=$CPU_ARCHITECTURE_NAME" >> $GITHUB_ENV
echo "CPU_CORES_NUM=$CPU_CORES_NUM" >> $GITHUB_ENV
echo "CPU_CORES=$CPU_CORES" >> $GITHUB_ENV
echo "OPERATING_SYSTEM_NAME=$OPERATING_SYSTEM_NAME" >> $GITHUB_ENV
echo "OPERATING_SYSTEM_NAME_SHORT=$OPERATING_SYSTEM_NAME_SHORT" >> $GITHUB_ENV
echo "SRC_TDJNI_LIBNAME=$SRC_TDJNI_LIBNAME" >> $GITHUB_ENV
echo "DEST_TDJNI_LIBNAME=$DEST_TDJNI_LIBNAME" >> $GITHUB_ENV
2020-12-26 14:00:49 +01:00
- name: Install dependencies
shell: bash
2020-12-26 12:09:32 +01:00
run: |
2020-12-26 14:00:49 +01:00
echo "REVISION: $REVISION"
source ./github-workflows/install-dependencies.sh
2020-12-26 15:06:44 +01:00
- name: Build
shell: bash
run: |
echo "REVISION: $REVISION"
source ./github-workflows/build.sh
2020-12-26 12:09:32 +01:00
- uses: actions/upload-artifact@v2
with:
name: tdlight-${{ env.SAFE_ARCH }}
path: tdlib/lib