forked from performancecopilot/pcp
-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (129 loc) · 5.95 KB
/
daily_qa.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: Daily QA
on:
schedule:
- cron: '0 19 * * *'
workflow_dispatch:
jobs:
qa:
name: ${{ matrix.platform }}-${{ matrix.runner }}
if: github.repository == 'performancecopilot/pcp' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {platform: ubuntu1604, runner: container, os: ubuntu-20.04}
- {platform: ubuntu1804, runner: direct, os: ubuntu-18.04}
- {platform: ubuntu1804i386, runner: container, os: ubuntu-20.04}
- {platform: ubuntu2004, runner: direct, os: ubuntu-20.04}
- {platform: debian10, runner: container, os: ubuntu-20.04}
- {platform: debian11, runner: container, os: ubuntu-20.04}
- {platform: fedora31, runner: container, os: ubuntu-20.04}
- {platform: fedora32, runner: container, os: ubuntu-20.04}
- {platform: fedora33, runner: container, os: ubuntu-20.04}
- {platform: fedora_rawhide, runner: container, os: ubuntu-20.04}
- {platform: centos6, runner: container, os: ubuntu-20.04}
- {platform: centos7, runner: container, os: ubuntu-20.04}
- {platform: centos8, runner: container, os: ubuntu-20.04}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Set up Python 3.6+
if: matrix.platform == 'ubuntu1604'
uses: actions/setup-python@v2
with:
python-version: '>=3.6'
- name: Upgrade conmon to 2.0.26
if: matrix.runner == 'container'
run: sudo .github/workflows/upgrade_conmon.sh
- name: Setup
run: |
python3 -c 'import yaml' || pip3 install pyyaml
mkdir -p artifacts/build artifacts/test
touch artifacts/test/.keep
for i in $(seq 1 10)
do
if [ $i -gt 1 ]; then
echo && echo "Probably network error, wait 5 min and try again ($i/10)..."
sleep 300
sudo podman system prune -a -f
fi
./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} setup && exit 0 || true
done
exit 1
- name: Install build dependencies
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} task install_build_dependencies
- name: Build
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} task build
- name: Copy build artifacts
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} artifacts build --path ./artifacts/build
- name: Publish build artifacts
uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.platform }}-${{ matrix.runner }}
path: ./artifacts/build
- name: Install
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} task install
- name: Initialize QA
id: init_qa
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} task init_qa
- name: QA
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} task qa || true
- name: Copy test results
if: always() && steps.init_qa.outcome == 'success'
run: ./build/ci/run.py --runner ${{ matrix.runner }} --platform ${{ matrix.platform }} artifacts test --path ./artifacts/test
- name: Publish test results
if: always() && steps.init_qa.outcome == 'success'
uses: actions/upload-artifact@v2
with:
name: test-${{ matrix.platform }}-${{ matrix.runner }}
path: ./artifacts/test
report:
name: Publish Test Report
if: always() && github.repository == 'performancecopilot/pcp'
needs: qa
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Checkout qa-reports
uses: actions/checkout@v2
with:
repository: ${{ github.repository_owner }}/qa-reports
path: qa-reports
ssh-key: ${{ secrets.QA_REPORT_DEPLOY_KEY }}
- name: Setup
run: |
wget -q -O allure-commandline.zip https://repo1.maven.org/maven2/io/qameta/allure/allure-commandline/2.13.8/allure-commandline-2.13.8.zip
unzip -d /opt allure-commandline.zip
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Generate test report
run: |
./build/ci/test-report.py \
--commit ${GITHUB_SHA} \
--allure-results ./allure-results \
--slack-channel ${SLACK_CHANNEL} \
--github-run-url "https://github.com/${{ github.repository_owner }}/pcp/actions/runs/${{ github.run_id }}" \
--qa-report-url "https://${{ github.repository_owner }}.github.io/qa-reports"
cp ./build/ci/allure/categories.json ./allure-results
# disable history, because the history.json file is getting bigger than 100 MB (max GitHub file size)
# [ -d qa-reports/docs/history ] && cp -r qa-reports/docs/history ./allure-results
/opt/allure-*/bin/allure generate
env:
SLACK_CHANNEL: C011ERBFQGN
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: Publish QA report
run: |
rm -rf qa-reports/test-* qa-reports/docs
mv artifacts/test-* qa-reports/
mv allure-report qa-reports/docs
cd qa-reports
git config --local user.name "GitHub Actions"
git config --local user.email "[email protected]"
git add .
git commit --amend -m "QA Report of ${{ github.repository_owner }}/pcp@${GITHUB_SHA}"
git push -f
echo "::warning::Complete test report is available at https://${{ github.repository_owner }}.github.io/qa-reports/"