Skip to content

Commit

Permalink
testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayamInSync committed Oct 26, 2024
1 parent 9863dde commit 37445c6
Showing 1 changed file with 41 additions and 13 deletions.
54 changes: 41 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive" # For Google Test
submodules: "recursive"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand All @@ -35,37 +35,65 @@ jobs:
ninja-build \
cmake \
build-essential
pip install "pybind11[global]"
- name: Install build dependencies (macOS)
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install ninja pybind11 cmake
pip install --upgrade pip
pip install pytest meson meson-python numpy
# Verify ninja is installed and in PATH
which ninja
pip install --upgrade pip wheel setuptools
pip install "pybind11[global]"
# Verify the environment setup
- name: Verify environment
run: |
echo "Python: $(python --version)"
echo "Pip: $(pip --version)"
echo "Ninja: $(which ninja)"
ninja --version
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pytest meson meson-python ninja numpy
pip install pytest meson>=1.3.2 meson-python numpy ninja
- name: Configure Meson
run: meson setup build
run: |
# On macOS, ensure ninja is in the system PATH
if [ "$RUNNER_OS" = "macOS" ]; then
export PATH="/usr/local/bin:$PATH"
fi
meson setup build
- name: Build
run: meson compile -C build
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
export PATH="/usr/local/bin:$PATH"
fi
meson compile -C build
- name: Run C++ Tests
run: meson test -C build -v
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
export PATH="/usr/local/bin:$PATH"
fi
meson test -C build -v
- name: Install Python Package
run: pip install -e .
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
export PATH="/usr/local/bin:$PATH"
fi
pip install -e .
- name: Run Python Tests
run: pytest python/tests -v
run: |
if [ "$RUNNER_OS" = "macOS" ]; then
export PATH="/usr/local/bin:$PATH"
fi
# Verify module can be imported
python -c "import enigma; print('Enigma import successful')"
# Run tests
pytest python/tests -v
- name: Upload Test Results
if: failure()
Expand Down

0 comments on commit 37445c6

Please sign in to comment.