Skip to content

Merge pull request #4 from janthmueller:dev #12

Merge pull request #4 from janthmueller:dev

Merge pull request #4 from janthmueller:dev #12

Workflow file for this run

# .github/workflows/python-tests.yml
name: Unit Tests
on:
push:
branches:
- '*' # Trigger on push to all branches
jobs:
test:
runs-on: ubuntu-latest # The environment to run the job in
steps:
- name: Checkout code
uses: actions/checkout@v3 # Checkout the repository code
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Specify the Python version to use
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then
echo "requirements.txt found, installing dependencies..."
python -m pip install --upgrade pip
pip install -r requirements.txt
else
echo "requirements.txt not found, skipping dependency installation."
fi
- name: Run tests
run: |
mkdir -p test-results # Create directory for test results
python -m unittest discover -s tests -p "*test.py" | tee test-results/test_output.log
# Here, we're redirecting output to a log file in the test-results directory
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: unittest-results
path: test-results/test_output.log