Skip to content

ci: Add CI workflow for Python projects #1

ci: Add CI workflow for Python projects

ci: Add CI workflow for Python projects #1

Workflow file for this run

name: CI

Check failure on line 1 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

(Line: 11, Col: 1): Unexpected value 'cancel-previous-runs'
on:
push:
branches:
- main
pull_request:
branches:
- main
cancel-previous-runs:
concurrency_group: ci-${{ github.ref }}
concurrency: ${{ github.sha }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache-dependencies: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
pytest
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run linting
run: |
flake8 .