feat: Add initial tests for Tools #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: Debug Checkout | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "All files and directories (including hidden):" | |
ls -la | |
echo "Full directory structure:" | |
find . -type f | |
echo "Git status:" | |
git status | |
echo "Git branch:" | |
git branch | |
- name: Debug Directory | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "Directory contents:" | |
ls -la | |
echo "Python location:" | |
which python3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Debug Python Setup | |
run: | | |
echo "Python version:" | |
python --version | |
echo "Pip version:" | |
pip --version | |
echo "System path:" | |
echo $PATH | |
- name: Install pipenv | |
run: | | |
python -m pip install --upgrade pip | |
pip install pipenv | |
echo "Pipenv version:" | |
pipenv --version | |
- name: Cache pipenv virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install dependencies | |
run: | | |
echo "Installing dependencies..." | |
pipenv install | |
echo "Installed packages:" | |
pipenv run pip list | |
- name: Debug Test Environment | |
run: | | |
echo "Test directory contents:" | |
ls -R tests/ | |
echo "PYTHONPATH:" | |
echo $PYTHONPATH | |
- name: Run tests with coverage | |
run: | | |
echo "Starting tests..." | |
export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/tests | |
echo "Updated PYTHONPATH: $PYTHONPATH" | |
echo "Running mamba with specs directory:" | |
ls -la tests/specs/ | |
echo "Running tests now..." | |
pipenv run mamba tests/specs --enable-coverage --format=documentation | |
echo "Tests completed with exit code: $?" | |
- name: Generate coverage report | |
if: always() # Run even if tests fail | |
run: | | |
echo "Generating coverage reports..." | |
pipenv run coverage html | |
pipenv run coverage xml | |
pipenv run coverage report | |
echo "Coverage files:" | |
ls -la htmlcov/ | |
ls -la coverage.xml | |
- name: Upload coverage reports to Codecov | |
if: always() # Run even if tests fail | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
- name: Upload coverage report artifact | |
if: always() # Run even if tests fail | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-report | |
path: | | |
htmlcov/ | |
coverage.xml | |
.coverage |