-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (71 loc) · 2.72 KB
/
scrapers_runner.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
on:
schedule:
- cron: '00 05 * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Add Python Path
run: echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
sudo apt-get install curl
- name: Set up Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- name: Download and install Allure Commandline 2.25.0
run: |
curl -o allure-commandline.zip -Ls https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.25.0/allure-commandline-2.25.0.zip
unzip allure-commandline.zip -d allure
rm allure-commandline.zip
chmod +x allure/allure-2.25.0/bin/allure
- name: Run pytest with Allure reporting
continue-on-error: true
env:
API_KEY: ${{ secrets.API_KEY }}
run: |
pytest tests/ --alluredir=docs/allure-results
- name: Keep previous run history
continue-on-error: true
run: |
allure/allure-2.25.0/bin/allure generate --clean docs/allure-results
rm -rf docs/allure-results/history
mv -f allure-report/history docs/allure-results
mv -f docs/environment.properties docs/allure-results
- name: Generate Executor JSON
run: |
echo '{
"name": "GitHub Actions",
"type": "github",
"url": "https://github.com/peviitor-ro/RaresTestHub/actions/runs/'"${GITHUB_RUN_ID}"'",
"buildName": "'"${GITHUB_RUN_NUMBER}"'",
"buildUrl": "https://github.com/peviitor-ro/RaresTestHub/actions/runs/'"${GITHUB_RUN_ID}"'",
"reportName": "Allure Report",
"reportUrl": "https://github.com/peviitor-ro/RaresTestHub/actions/runs/'"${GITHUB_RUN_ID}"'"
}' > docs/allure-results/executor.json
- name: Generate Allure report
run: |
allure/allure-2.25.0/bin/allure generate --single-file --clean docs/allure-results
- name: Move Allure results to docs folder
run: |
rm -rf docs/api_test_report.html
mv -f allure-report/index.html docs/api_test_report.html
- name: Commit and push Allure report
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add docs/api_test_report.html docs/allure-results
git commit -m "Add Allure test report"
git push origin main