Skip to content

Create test.yaml

Create test.yaml #1

Workflow file for this run

name: Python CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-and-lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.x'] # Python 3.8 and the latest Python 3 version
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Install dependencies
- name: Install dependencies
working-directory: assignments
run: |
python -m pip install --upgrade pip
pip install .
# Run pytest
- name: Run pytest
working-directory: assignments/life_expectancy
run: |
pytest
# Run pylint
- name: Run pylint
working-directory: assignments/life_expectancy
run: |
pylint $(find . -type f -name "*.py")