-
-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (78 loc) · 2.39 KB
/
workflow.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
name: Checking
on: push
jobs:
setup-requirements:
name: Get Requirements
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: "3.12.0"
- name: Check out repository code
uses: actions/checkout@v4.2.2
- name: Install Hatch
run: python -m pip install --upgrade hatch
- name: Generate Requirements
run: python -m hatch dep show requirements > requirements.txt
- name: Upload Requirements
uses: actions/upload-artifact@v4.4.3
with:
name: requirements
path: requirements.txt
pylint:
name: PyLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository code
uses: actions/checkout@v4.2.2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: "3.12.0"
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- name: Install dependencies
run: |
pipenv install --deploy --dev
- name: Pylint on esbmc_ai
run: |
pipenv run pylint esbmc_ai
test:
name: PyTest
needs: setup-requirements
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out repository code
uses: actions/checkout@v4.2.2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v5.3.0
with:
python-version: "3.12.0"
- name: Download Requirements
uses: actions/download-artifact@v4.1.8
with:
name: requirements
path: .
- name: Install Environment
run: python -m pip install --upgrade pipenv wheel
- name: Cache Pipenv
id: cache-pipenv
uses: actions/cache@v4.1.2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install -r requirements.txt
pipenv lock
- name: Run test suite
run: pipenv run pytest -v