Skip to content

added dependencies and pytest to ci file #1

added dependencies and pytest to ci file

added dependencies and pytest to ci file #1

Workflow file for this run

name: CI # Give this workflow a name
on: # Define when the workflow runs
push:
branches: ["main"] # run this workflow when pushing to main
pull_request:
branches: ["main"] # run this workflow when pulling from main
jobs:
build:
runs-on: ubuntu-latest # run this job inside an Ubuntu Linux VM
strategy:
matrix:
python-version: ["3.9","3.10","3.11","3.12"] # Test against multiple python versions - if one fails the whoel workflow fails
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Chache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
# Cache is unique per OS + Python version. Reqs content
key: $ {{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt # executes shell command in VM
- name: Run tests
run: pytest