-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (51 loc) · 1.81 KB
/
ci-macos.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: CI macOS
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:
os: [macos-13, macos-14]
feature: [local-tdlib, download-tdlib, pkg-config, docs]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download TDLib
if: matrix.feature == 'local-tdlib' || matrix.feature == 'pkg-config'
run: |
gh release download --pattern ${{ runner.arch == 'ARM64' && 'tdlib-*-macos-aarch64.zip' || 'tdlib-*-macos-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 "DYLD_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 }}