Skip to content

Add documentation for config part #32

Add documentation for config part

Add documentation for config part #32

Workflow file for this run

name: Build Windows
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
API_HASH: a3406de8d171bb422bb6ddf3bbd800e2
API_ID: 94575
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore cache TDLib
id: cache-tdlib-restore
uses: actions/cache/restore@v4
with:
path: td/
key: ${{ runner.os }}-TDLib
- name: Build TDLib
if: steps.cache-tdlib-restore.outputs.cache-hit != 'true'
run: |
git clone https://github.com/tdlib/td.git
cd td
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
git checkout cd5e746ec203c8c3c61647e0886a8df8c1e78e41
./bootstrap-vcpkg.bat
./vcpkg.exe install gperf:x64-windows openssl:x64-windows zlib:x64-windows
cd ..
rm -rf build
mkdir build
cd build
cmake -A x64 -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_TOOLCHAIN_FILE:FILEPATH=../vcpkg/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --target install --config Release
shell: bash
- name: Save cache TDLib
uses: actions/cache/save@v4
if: steps.cache-tdlib-restore.outputs.cache-hit != 'true'
with:
path: td/
key: ${{ steps.cache-tdlib-restore.outputs.cache-primary-key }}
- name: Extract TDLib
run: cp -r ./td/tdlib ./
shell: bash
- name: Install pkg-config
run: |
mkdir pkg-config
cd pkg-config
curl -kLSsO http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip
curl -kLSsO http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip
curl -kLSsO http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
unzip -q pkg-config_0.26-1_win32.zip -d pkg-config_0.26-1_win32
unzip -q glib_2.28.8-1_win32.zip -d glib_2.28.8-1_win32
unzip -q gettext-runtime_0.18.1.1-2_win32.zip -d gettext-runtime_0.18.1.1-2_win32
cp ./gettext-runtime_0.18.1.1-2_win32/bin/intl.dll ./pkg-config_0.26-1_win32/bin/
cp ./glib_2.28.8-1_win32/bin/* ./pkg-config_0.26-1_win32/bin/
shell: bash
- name: Set environment variables
run: |
echo "$((Get-Item .).FullName)\pkg-config\pkg-config_0.26-1_win32\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "PKG_CONFIG_PATH=$((Get-Item .).FullName)\tdlib\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$((Get-Item .).FullName)\tdlib\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: pwsh
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run cargo build
run: cargo build --verbose
- name: Run cargo test
run: cargo test --verbose -- --nocapture --test-threads=1
- name: Run cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run cargo fmt
run: cargo +nightly fmt --all -- --check