Update README.md #1174
This file contains hidden or 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: Python CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# repository code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
# set up | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
# dependencies, if any | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f workbook/ch03/ci/requirements.txt ]; then pip install -r requirements.txt; fi | |
# PYTHONPATH (include script's parent directory, if needed) | |
- name: Set PYTHONPATH | |
run: echo "PYTHONPATH=$PYTHONPATH:$(pwd)/workbook/ch03/ci" >> $GITHUB_ENV | |
# check where we are? /home/runner/work/bb/bb | |
- name: Print working directory | |
run: pwd | |
# right place and files? | |
- name: List files | |
run: ls -R workbook/ch03/ci | |
# unit tests using Python's unittest: workbook/ch03/ci | |
- name: Run tests | |
run: | | |
python -m unittest discover -s workbook/ch03/ci -p 'test_*.py' |