Skip to content

Commit

Permalink
fix(ci): add OpenSSL configuration for cross-compilation
Browse files Browse the repository at this point in the history
- Add OpenSSL installation for musl targets
- Configure OpenSSL build environment variables
- Add platform-specific dependencies for Linux and macOS
- Improve musl toolchain setup
  • Loading branch information
jamesbrink committed Feb 9, 2025
1 parent 97ed293 commit 667536d
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,41 @@ jobs:
components: clippy, rustfmt
targets: ${{ matrix.target }}

- name: Install cross-compilation dependencies
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y qemu-user
sudo apt-get install -y qemu-user musl-tools pkg-config libssl-dev
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: |
brew install openssl@3
- name: Setup musl build environment
if: contains(matrix.target, 'musl')
run: |
# Install musl-gcc
sudo apt-get install -y musl-tools
# Install musl OpenSSL
wget https://www.openssl.org/source/openssl-3.1.4.tar.gz
tar xzf openssl-3.1.4.tar.gz
cd openssl-3.1.4
# Configure and build OpenSSL for musl
CC="musl-gcc -fPIC" ./Configure no-shared no-async --prefix=/usr/local/musl --openssldir=/usr/local/musl linux-x86_64
make -j$(nproc)
sudo make install
cd ..
# Set environment variables for OpenSSL
echo "OPENSSL_DIR=/usr/local/musl" >> $GITHUB_ENV
echo "OPENSSL_STATIC=1" >> $GITHUB_ENV
- name: Setup cross-compilation for ARM
if: contains(matrix.target, 'aarch64') || contains(matrix.target, 'armv7')
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
cargo install cross
- name: Cache dependencies
uses: actions/cache@v4
with:
Expand Down

0 comments on commit 667536d

Please sign in to comment.