-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (38 loc) · 1.21 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
ci:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
poetry-version: ["1.7.1"]
runs-on: ubuntu-latest
env:
SOURCE_FILES: code_size_counter tests/test_code_size_counter.py
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Setup Python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Python Poetry Action
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install dependencies
run: poetry install
- name: Check formatting
run: poetry run black --check $SOURCE_FILES
- name: Lint with flake8
run: poetry run flake8 $SOURCE_FILES
- name: Test with unittest module
run: |
poetry run python -m unittest discover tests -v