-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 3.47 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Copyright (C) 2020-2024 Serghei Iakovlev <gnu@serghei.pl>
#
# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file. If not, see <https://www.gnu.org/licenses/>.
name: CI
on:
push:
branches-ignore:
# These should always correspond to pull requests, so ignore them for
# the push trigger and let them be triggered by the pull_request
# trigger, avoiding running the workflow twice. This is a minor
# optimization so there's no need to ensure this is comprehensive.
- 'dependabot/**'
pull_request:
branches:
- main
env:
PYTHONUNBUFFERED: '1'
defaults:
run:
shell: bash
jobs:
test:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# The maximum number of minutes to let a workflow run
# before GitHub automatically cancels it. Default: 360
timeout-minutes: 30
strategy:
# When set to true, GitHub cancels
# all in-progress jobs if any matrix job fails.
fail-fast: false
matrix:
python:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 5
- name: Set up Python ${{ matrix.python }}
id: setup-python
uses: actions/setup-python@v5.3.0
with:
python-version: ${{ matrix.python }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.4
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: testing-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
testing-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
- name: Validates the content of the pyproject.toml
run: poetry check
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --with=testing --without=docs --without=build --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run unit tests with coverage
run: |
source $VENV
coverage run -m pytest ./gstore ./tests
coverage combine
coverage xml
- uses: codecov/codecov-action@v5.1.1
if: success()
with:
fail_ci_if_error: false
name: codecov-umbrella
flags: unittests
env_vars: OS,PYTHON
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Success Reporting
if: success()
run: git log --format=fuller -5