update to install #8
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: Run Unit Tests | |
on: | |
push: | |
branches: | |
- '**' # Run on all branches | |
pull_request: | |
branches: | |
- '**' # Run on all pull requests | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: [3.9, 3.11] # Specify Python versions >= 3.8 | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Step 2: Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Step 4: Install package | |
- name: Install the Project | |
run: pip install -e . | |
# Step 5: Run unit tests and save logs | |
- name: Run Unit Tests | |
run: | | |
pytest --maxfail=0 --disable-warnings | tee pytest_${{ matrix.python-version }}.log | |
# Step 6: Always save logs | |
- name: Save Test Logs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pytest-logs-${{ matrix.python-version }} | |
path: pytest_${{ matrix.python-version }}.log |