forked from eclipse-volttron/volttron-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (77 loc) · 2.6 KB
/
run-tests.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
name: Run Pytests
on:
push:
branches: '*'
# - main
# - develop
# - releases/**
paths:
- '**.py'
- '**.yml'
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- '**.py'
defaults:
run:
shell: bash
env:
LANG: en_US.utf-8
LC_ALL: en_US.utf-8
PROJECT_NAME: volttron-core
jobs:
run-tests:
strategy:
matrix:
os: ["ubuntu-20.04", "ubuntu-22.04"]
python: ["3.8", "3.9", "3.10"]
runs-on: ${{ matrix.os }}
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
id: setup-python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.0b2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# #----------------------------------------------
# # load cached venv if cache exists
# #----------------------------------------------
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v2.1.7
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
# #----------------------------------------------
# # install dependencies if cache does not exist
# #----------------------------------------------
# - name: Install dependencies
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
# run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, and run tests.
#----------------------------------------------
- name: Install library and run tests
run: |
poetry install --no-interaction
poetry run pytest