-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
69 lines (64 loc) · 1.51 KB
/
.gitlab-ci.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
stages:
- testing # Tests run
- history_save # Save allure history
- reports # Report generation
- deploy # Report publication in gitlab pages
docker_job:
stage: testing
tags:
- docker
image: python:3.9-alpine
before_script:
- pip install --user poetry
- python -m poetry install
script:
- python -m poetry run python -m pytest -v tests --alluredir=./allure-results tests/
allow_failure: true
artifacts:
when: always
paths:
- ./allure-results
expire_in: 1 day
history_job:
stage: history_save
tags:
- docker
image: storytel/alpine-bash-curl
script:
# https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html#downloading-artifacts
- 'curl --location --output artifacts.zip "https://gitlab.com/api/<namespace>/<project>/-/jobs/artifacts/master/download?job=pages&job_token=$CI_JOB_TOKEN"'
- apk add unzip
- unzip artifacts.zip
- chmod -R 777 public
- cp -r ./public/history ./allure-results
allow_failure: true
artifacts:
paths:
- ./allure-results
expire_in: 1 day
rules:
- when: always
allure_job:
stage: reports
tags:
- docker
image: frankescobar/allure-docker-service
script:
- allure generate -c ./allure-results -o ./allure-report
artifacts:
paths:
- ./allure-results
- ./allure-report
expire_in: 1 day
rules:
- when: always
pages:
stage: deploy
script:
- mkdir public
- mv ./allure-report/* public
artifacts:
paths:
- public
rules:
- when: always