-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (60 loc) · 1.93 KB
/
tests.yaml
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# We should restore the cache and remove extra requirements installations after this is resolved https://github.com/actions/setup-python/issues/182
name: Tests
on:
push:
branches: ["master"]
pull_request:
branches: ["*"]
workflow_dispatch:
inputs:
release:
description: 'Release package'
required: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
cache: "pip"
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Set Cache
uses: actions/cache@v4
id: cache # name for referring later
with:
path: .venv/
# The cache key depends on poetry.lock
key: ${{ runner.os }}-cache-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-cache-
${{ runner.os }}-
- name: Install Dependencies
# if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install -U pip poetry
poetry --version
poetry config --local virtualenvs.in-project true
poetry install
- name: Test and Lint
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
./scripts/test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true