Merge pull request #7 from yohannestayez/task5 #15
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: Python application | |
on: | |
push: | |
branches: [ "main" ] # Runs on push to the main branch | |
pull_request: | |
branches: [ "main" ] # Runs on pull request to the main branch | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest # Use the latest version of Ubuntu | |
steps: | |
- uses: actions/checkout@v4 # Checks out the repository code | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" # Set Python 3.9 version | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip # Upgrade pip | |
pip install flake8 # Install flake8 for linting | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # Install dependencies from requirements.txt if available | |
- name: Test with unittest | |
run: | | |
python -m unittest discover # Run unittests | |