-
Notifications
You must be signed in to change notification settings - Fork 7
67 lines (63 loc) · 2.07 KB
/
testing.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
name: 🧪 CI Pipeline 1 -- Testing
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- "**"
tags:
- "*.*.*"
paths:
- "**"
- "!docs/**"
- "!examples/**"
pull_request:
paths:
- "**"
- "!docs/**"
- "!examples/**"
env:
TERM: xterm
VENV_PATH: .venv
PYTHON_VERSION: "3.11"
jobs:
# Verifies pep8, pyflakes and circular complexity
flake8:
name: 🚨 Lint Python Code
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: ⬇️ Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python v${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 🔽 Install flake8
run: pip install flake8
- name: ⌛ Run checks
run: flake8 -v rocrate_validator tests
# Runs the tests
test:
name: ⌛ Run tests
runs-on: ubuntu-latest
needs: [flake8]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🐍 Set up Python v${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 🔄 Upgrade pip
run: pip install --upgrade pip
- name: 🐍 Initialise a virtual env
run: python -m venv ${VENV_PATH}
- name: 🐍 Enable virtual env
run: source ${VENV_PATH}/bin/activate
- name: 🔽 Install Poetry
run: pip install poetry
- name: 🔽 Install dependencies
run: poetry install --no-interaction --no-ansi
- name: ⌛ Run tests
run: poetry run pytest