Skip to content

Update CI, Makefile and build.rs #49

Update CI, Makefile and build.rs

Update CI, Makefile and build.rs #49

Workflow file for this run

name: CI Linux
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_run:
workflows: [ CD ]
types: [ completed ]
branches: [ main ]
env:
GH_TOKEN: ${{ github.token }}
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
API_HASH: a3406de8d171bb422bb6ddf3bbd800e2
API_ID: 94575
jobs:
ci:
strategy:
fail-fast: false
matrix:
feature: [local-tdlib, download-tdlib, pkg-config, docs]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download TDLib
if: matrix.feature == 'local-tdlib' || matrix.feature == 'pkg-config'
run: |
gh release download --pattern 'tdlib-*-linux-x86_64.zip'
unzip -q *.zip -d .
- name: Set pkg-config environment variables
if: matrix.feature == 'pkg-config'
run: |
echo "PKG_CONFIG_PATH=$(pwd)/tdlib/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$(pwd)/tdlib/lib" >> $GITHUB_ENV
- name: Set local-tdlib environment variables
if: matrix.feature == 'local-tdlib'
run: echo "LOCAL_TDLIB_PATH=$(pwd)/tdlib/" >> $GITHUB_ENV
- name: Run cargo build
run: cargo build --verbose --features ${{ matrix.feature }}
- name: Run cargo test
run: cargo test --verbose --workspace --exclude tdlib-rs -- --nocapture --test-threads=1
- name: Run cargo clippy
run: cargo clippy --all-targets --features ${{ matrix.feature }} -- -D warnings
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo run
if: matrix.feature != 'docs'
run: cargo run --package tdlib-rs --example test_ci --features ${{ matrix.feature }}