tdesktop/.github/workflows/linux.yml

131 lines
3.5 KiB
YAML
Raw Normal View History

name: Linux.
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/linux.yml'
- 'snap/**'
- 'Telegram/build/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/linux.yml'
- 'snap/**'
- 'Telegram/build/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
jobs:
linux:
2020-11-12 09:24:13 +00:00
name: CentOS 7
runs-on: ubuntu-latest
2020-11-12 09:24:13 +00:00
container:
image: ghcr.io/${{ github.repository }}/centos_env
2020-11-12 09:24:13 +00:00
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
defaults:
run:
2022-11-23 17:10:44 +00:00
shell: scl enable rh-python38 -- scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0}
strategy:
matrix:
defines:
- ""
- "DESKTOP_APP_DISABLE_X11_INTEGRATION"
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"
env:
UPLOAD_ARTIFACT: "false"
steps:
- name: Get repository name.
2020-10-25 01:46:27 +00:00
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
2020-03-20 16:32:06 +00:00
- name: Clone.
2022-11-07 12:32:59 +00:00
uses: actions/checkout@v3.1.0
2020-03-20 16:32:06 +00:00
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
- name: First set up.
run: |
gcc --version
2022-07-26 02:20:50 +00:00
ln -s /usr/src/Libraries
2020-08-14 06:45:41 +00:00
- name: Telegram Desktop build.
run: |
cd $REPO_NAME/Telegram
DEFINE=""
if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON"
echo Define from matrix: $DEFINE
2020-10-25 01:46:27 +00:00
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV
else
2020-10-25 01:46:27 +00:00
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV
fi
2020-03-19 11:07:29 +00:00
./configure.sh \
-D CMAKE_C_FLAGS_DEBUG="" \
-D CMAKE_CXX_FLAGS_DEBUG="" \
2020-11-18 00:55:38 +00:00
-D CMAKE_C_FLAGS="-Werror" \
-D CMAKE_CXX_FLAGS="-Werror" \
-D CMAKE_EXE_LINKER_FLAGS="-s" \
2020-03-19 11:07:29 +00:00
-D TDESKTOP_API_TEST=ON \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \
2020-03-19 11:07:29 +00:00
$DEFINE
cmake --build ../out --config Debug --parallel
- name: Check.
run: |
filePath="$REPO_NAME/out/Debug/Telegram"
if test -f "$filePath"; then
echo "Build successfully done! :)"
size=$(stat -c %s "$filePath")
echo "File size of ${filePath}: ${size} Bytes."
else
echo "Build error, output file does not exist."
exit 1
fi
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
run: |
cd $REPO_NAME/out/Debug
mkdir artifact
mv Telegram artifact/
- uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.REPO_NAME }}/out/Debug/artifact/