tdlight/.github/workflows/build.yaml

51 lines
1.5 KiB
YAML
Raw Normal View History

2020-11-10 13:04:15 +01:00
name: Build TDLib
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
build:
2020-11-15 14:06:53 +01:00
runs-on: ubuntu-20.04
2020-11-10 13:22:21 +01:00
strategy:
matrix:
arch: [linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/ppc64le]
2020-11-10 13:04:15 +01:00
steps:
2020-11-10 17:21:23 +01:00
- name: Setup variables
run: |
ARCH=${{ matrix.arch }}
2020-11-10 19:09:33 +01:00
SAFE_ARCH=$(echo $ARCH | sed 's/\//\-/g')
2020-11-10 17:21:23 +01:00
echo "SAFE_ARCH=$SAFE_ARCH" >> $GITHUB_ENV
2020-11-10 14:24:16 +01:00
- name: Install sudo package
2020-11-10 14:27:42 +01:00
run: |
(apt-get update || true) 2>/dev/null
2020-11-10 14:28:44 +01:00
(apt-get install -y sudo || true) 2>/dev/null
2020-11-10 14:27:42 +01:00
sudo apt update
2020-11-10 13:04:15 +01:00
- uses: actions/checkout@v2
with:
submodules: "recursive"
2020-11-10 13:22:21 +01:00
- name: Cache ccache
2020-11-10 17:21:23 +01:00
id: cache-ccache
2020-11-10 13:11:00 +01:00
uses: actions/cache@v2
with:
path: ~/.ccache
2020-11-10 17:21:23 +01:00
key: ${{ runner.os }}-${{ env.SAFE_ARCH }}-ccache-all
2020-11-10 13:11:00 +01:00
restore-keys: |
2020-11-10 17:21:23 +01:00
${{ runner.os }}-${{ env.SAFE_ARCH }}-ccache-
2020-11-10 13:04:15 +01:00
- name: Install build tools
2020-11-15 15:08:03 +01:00
run: sudo apt-get install -y make git zlib1g-dev libssl-dev gperf php-cli cmake clang-6.0 libc++-dev libc++abi-dev ccache
2020-11-10 13:04:15 +01:00
- name: Build
run: |
mkdir build
cd build
2020-11-15 14:06:53 +01:00
CXXFLAGS="-stdlib=libc++" CC=/usr/bin/clang-10 CXX=/usr/bin/clang++-10 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib ..
2020-11-15 15:08:03 +01:00
cmake --build . --target install -- -j4
2020-11-10 13:58:57 +01:00
- uses: actions/upload-artifact@v2
with:
2020-11-10 17:21:23 +01:00
name: tdlight-${{ env.SAFE_ARCH }}
2020-11-10 15:59:00 +01:00
path: tdlib/lib
2020-11-10 14:24:16 +01:00