forked from openimsdk/test-e2e
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.48 KB
/
main.yaml
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
name: Continuous Integration
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: main-repo
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y xvfb libxi6 libgconf-2-4
cd ${{ github.workspace }}/main-repo
pip install -r requirements.txt
- name: Checkout compose repository
uses: actions/checkout@v4
with:
repository: "openimsdk/openim-docker"
path: "compose-repo"
- name: Get Internal IP Address
id: get-ip
run: |
IP=$(hostname -I | awk '{print $1}')
echo "The IP Address is: $IP"
echo "::set-output name=ip::$IP"
- name: Start services using Docker Compose
run: |
cd ${{ github.workspace }}/compose-repo
sed -i 's|MINIO_EXTERNAL_ADDRESS=.*|MINIO_EXTERNAL_ADDRESS=http://${{ steps.get-ip.outputs.ip }}:10005|' ${{ github.workspace }}/compose-repo/.env
cat .env
docker compose up -d
sleep 60
- name: Run tests with Xvfb and generate Allure results
run: |
cd ${{ github.workspace }}/main-repo
xvfb-run --auto-servernum --server-args='-screen 0 1920x1080x24' pytest -v -s ./script --alluredir=./reports/allure-results
env:
LANG: zh_CN.UTF-8
- name: Upload Allure results to Artifacts
uses: actions/upload-artifact@v4
with:
name: allure-results
path: ${{ github.workspace }}/main-repo/reports/allure-results
- name: Checkout gh-pages for report history
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
# Optional: Serve Allure report
- name: Serve Allure report
uses: simple-elf/[email protected]
with:
allure_results: main-repo/reports/allure-results
gh_pages: gh-pages
allure_report: main-repo/reports/allure-report
allure_history: gh-pages/allure-history
env:
LANG: zh_CN.UTF-8
- name: Deploy report to Github Pages
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: gh-pages/allure-history