-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (63 loc) · 1.93 KB
/
continuous-integration.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
---
name: Automated tests
on: pull_request
jobs:
auto-formatting:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12.1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install 'black[python2]==21.12b0'
pip install click==8.0.2 # newer version is incompatible
- name: Check formatting
run: |
black -t py27 --check web/
black -t py27 --check web/**/*.py.example
unit-tests-sqlite:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: start SUT
run: docker compose up --quiet-pull --detach --build
- name: run django test
run: docker compose run web './manage.py' test --failfast
robot-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: start SUT
run: docker compose up --quiet-pull --detach --build
- name: Set up Python 3.12.1
uses: actions/setup-python@v5
with:
python-version: 3.12.1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install robotframework
pip install robotframework-seleniumlibrary
- name: wait SUT to start
run: while ! curl -s -f 'http://localhost:3000/kipa' ; do sleep 2; docker ps; done
shell: bash
- name: run robot
run: |
robot \
--outputdir ./test-report \
--variable BROWSER:headlessfirefox \
--variable KIPA_URL:'http://localhost:3000/kipa' \
--exitonfailure \
web/robot/perustoiminnot.robot
- name: report
uses: actions/upload-artifact@v4
if: always()
with:
name: robot-test-report
path: ./test-report