-
Notifications
You must be signed in to change notification settings - Fork 33
83 lines (68 loc) · 2.63 KB
/
pkg-config.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: pkg-config
permissions:
contents: read
on:
push:
pull_request:
merge_group:
schedule:
- cron: '15 12 * * 3'
jobs:
build:
name: Build+test
runs-on: ${{ matrix.os }}
env:
PREFIX: /tmp/librustls
strategy:
matrix:
cc: [ clang, gcc ]
os: [ ubuntu-latest, macos-latest ]
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install pkg-config (macOS)
if: runner.os == 'macos-latest'
run: brew install pkg-config
- name: Show pkg-config version
run: pkg-config --version
- name: Install cargo-c (Ubuntu)
if: matrix.os == 'ubuntu-latest'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
run: |
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- name: Install cargo-c (macOS)
if: matrix.os == 'macos-latest'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-macos.zip
run: |
curl -L $LINK/$CARGO_C_FILE -o cargo-c-macos.zip
unzip cargo-c-macos.zip -d ~/.cargo/bin
- name: Install the library
# NOTE: We set --libdir explicitly to avoid per-system/distro path components
# that will complicate setting PKG_CONFIG_PATH/LD_LIBRARY_PATH.
run: >
CARGOFLAGS=--libdir=lib
make --file=Makefile.pkg-config PREFIX=${PREFIX} install
- name: Build the client/server examples
run: PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig make --file=Makefile.pkg-config PROFILE=debug
- name: Verify client is dynamically linked (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: LD_LIBRARY_PATH=$PREFIX/lib ldd target/client | grep "rustls"
- name: Verify server is dynamically linked (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: LD_LIBRARY_PATH=$PREFIX/lib ldd target/server | grep "rustls"
- name: Verify client is dynamically linked (macOS)
if: matrix.os == 'macos-latest'
run: LD_LIBRARY_PATH=$PREFIX/lib otool -L target/client | grep "rustls"
- name: Verify server is dynamically linked (macOS)
if: matrix.os == 'macos-latest'
run: LD_LIBRARY_PATH=$PREFIX/lib otool -L target/server | grep "rustls"
- name: Run the integration tests
run: LD_LIBRARY_PATH=$PREFIX/lib make --file=Makefile.pkg-config PROFILE=debug integration