Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run on void linux in CI #102

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 31 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,45 @@ jobs:
run: cargo fmt --check

test:
name: Test
needs: determine-changes
runs-on: ubuntu-latest
if: needs.determine-changes.outputs.only_docs != 'true'
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os_runner }}
strategy:
matrix:
include:
- os: ubuntu
os_runner: ubuntu-latest
- os: windows
os_runner: windows-latest
- os: macos
os_runner: macos-latest
- os: void
os_runner: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install OpenSSL (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev

- name: Install OpenSSL (macOS)
if: runner.os == 'macOS'
run: |
brew install openssl@3
echo "OPENSSL_DIR=$(brew --prefix openssl@3)" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig" >> $GITHUB_ENV

- name: Install OpenSSL (Windows)
if: runner.os == 'Windows'
run: |
choco install openssl --params='/InstallationPath:C:\OpenSSL\'
echo "OPENSSL_DIR=C:\OpenSSL" >> $env:GITHUB_ENV
echo "PKG_CONFIG_PATH=C:\OpenSSL\lib\pkgconfig" >> $env:GITHUB_ENV

- name: Run tests
run: cargo test --verbose
run: |
if [ "${{ matrix.os }}" = "void" ]; then
echo "Running tests in Void Linux container with Rust installation..."
docker run --platform linux/amd64 --rm -v "${{ github.workspace }}:/workspace" -w /workspace voidlinux/voidlinux:latest sh -c "\
echo 'repository=https://repo-us.voidlinux.org/current' > /etc/xbps.d/00-repository-main.conf && \
echo 'repository=https://repo-de.voidlinux.org/current' >> /etc/xbps.d/00-repository-main.conf && \
echo 'repository=https://repo-fi.voidlinux.org/current' >> /etc/xbps.d/00-repository-main.conf && \
xbps-install -Syu && \
xbps-install -y base-devel git curl gcc pkg-config openssl-devel cmake python3 make && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
export PATH=/root/.cargo/bin:\$PATH && \
rustc --version && \
cargo --version && \
RUST_BACKTRACE=1 cargo test"
else
cargo test
fi

build:
name: Build ${{ matrix.target }}
Expand Down
Loading