-
Notifications
You must be signed in to change notification settings - Fork 13
58 lines (47 loc) · 1.67 KB
/
main_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
name: Main Workflow
on: ['push', 'pull_request', 'workflow_dispatch']
jobs:
automated-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-version: ['3.8', '3.9', '3.10', '3.11']
name: Setup python ${{ matrix.python-version }} on ${{ matrix.os }}
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"
- run: echo "The name of the branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Validate python version
run: |
pythonVersion=$(python --version 2>&1)
if [[ $pythonVersion == "Python ${{ matrix.python-version }}"* ]];
then
echo "The current version is $pythonVersion."
else
echo "The current version is $pythonVersion; expected version is ${{ matrix.python-version }}"
exit 1
fi
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install poetry
poetry install
- name: Static analysis
run: |
source .venv/bin/activate
flake8 pyntelope/
- name: Run docker image
run: docker-compose up --build -d
- name: Run unit tests
run: |
source .venv/bin/activate
pytest