Skip to content

Commit

Permalink
add linux libraries to runner environment when os is linux
Browse files Browse the repository at this point in the history
  • Loading branch information
eberrigan committed Aug 2, 2024
1 parent 9ec64e8 commit 9af7619
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
# Otherwise core dumped in github actions
test_args: |
sudo apt install xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
sudo apt-get install libglapi-mesa libegl-mesa0 libegl1 libopengl0 libgl1-mesa-glx
sudo Xvfb :1 -screen 0 1024x768x24 </dev/null &
export DISPLAY=":1"
pytest tests -k 'not exclude_from_linux_pip_test'
Expand Down
42 changes: 39 additions & 3 deletions .github/workflows/build_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,45 @@ jobs:
conda build .conda_mac --output-folder build
echo "BUILD_PATH=$(pwd)/build" >> "$GITHUB_ENV"
# Test built conda package (Ubuntu and Windows)
- name: Test built conda package (Ubuntu and Windows)
if: matrix.os != 'macos-14'
# Test built conda package (Ubuntu)
- name: Test built conda package (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
shell: bash -l {0}
run: |
echo "Current build path: $BUILD_PATH"
conda deactivate
echo "Python executable before activating environment:"
which python
echo "Python version before activating environment:"
python --version
echo "Conda info before activating environment:"
conda info

echo "Creating and testing conda environment with sleap package..."
sudo apt-get update
sudo apt-get install libglapi-mesa libegl-mesa0 libegl1 libopengl0 libgl1-mesa-glx
conda create -y -n sleap_test -c file://$BUILD_PATH -c sleap/label/dev -c conda-forge -c nvidia -c anaconda sleap
conda activate sleap_test

echo "Python executable after activating sleap_test environment:"
which python
echo "Python version after activating sleap_test environment:"
python --version
echo "Conda info after activating sleap_test environment:"
conda info
echo "List of installed conda packages in the sleap_test environment:"
conda list
echo "List of installed pip packages in the sleap_test environment:"
pip list

echo "Testing sleap package installation..."
sleap_version=$(python -c "import sleap; print(sleap.__version__)")
echo "Test completed using sleap version: $sleap_version"

# Test built conda package (Windows)
- name: Test built conda package (Windows)
if: matrix.os == 'windows-2022'
shell: bash -l {0}
run: |
echo "Current build path: $BUILD_PATH"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Add Linux libraries
if: matrix.os == 'ubuntu-22.04'
# https://github.com/conda-forge/opencv-feedstock/issues/401#issue-2196393732
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-glx
- name: Setup Conda
uses: conda-incubator/[email protected]
with:
Expand Down

0 comments on commit 9af7619

Please sign in to comment.