You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
160 lines
4.7 KiB
160 lines
4.7 KiB
1 year ago
|
# Copyright © 2023 OpenIM. All rights reserved.
|
||
|
#
|
||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
# you may not use this file except in compliance with the License.
|
||
|
# You may obtain a copy of the License at
|
||
|
#
|
||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
#
|
||
|
# Unless required by applicable law or agreed to in writing, software
|
||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
# See the License for the specific language governing permissions and
|
||
|
# limitations under the License.
|
||
|
|
||
5 months ago
|
name: OpenIM E2E And API Test
|
||
1 year ago
|
|
||
1 year ago
|
on:
|
||
|
workflow_dispatch:
|
||
|
pull_request:
|
||
|
push:
|
||
|
schedule:
|
||
|
# run e2e test every 4 hours
|
||
|
- cron: 0 */4 * * *
|
||
|
|
||
9 months ago
|
env:
|
||
|
CALLBACK_ENABLE: true
|
||
|
|
||
1 year ago
|
jobs:
|
||
|
build:
|
||
|
name: Test
|
||
|
runs-on: ubuntu-latest
|
||
|
env:
|
||
|
GO111MODULE: on
|
||
|
steps:
|
||
|
|
||
|
- name: Set up Go 1.21
|
||
6 months ago
|
uses: actions/setup-go@v5
|
||
1 year ago
|
with:
|
||
|
go-version: 1.21
|
||
|
id: go
|
||
|
|
||
|
- name: Check out code into the Go module directory
|
||
11 months ago
|
uses: actions/checkout@v4
|
||
1 year ago
|
|
||
|
- name: Create e2e test
|
||
|
run: |
|
||
10 months ago
|
echo "...test e2e"
|
||
|
|
||
|
execute-linux-systemd-scripts:
|
||
|
name: Execute OpenIM script on ${{ matrix.os }}
|
||
|
runs-on: ${{ matrix.os }}
|
||
|
environment:
|
||
|
name: openim
|
||
|
strategy:
|
||
|
matrix:
|
||
|
go_version: ["1.20"]
|
||
|
os: ["ubuntu-latest"]
|
||
|
steps:
|
||
|
- name: Checkout code
|
||
|
uses: actions/checkout@v4
|
||
|
|
||
|
- name: Set up Go ${{ matrix.go_version }}
|
||
6 months ago
|
uses: actions/setup-go@v5
|
||
10 months ago
|
with:
|
||
|
go-version: ${{ matrix.go_version }}
|
||
|
id: go
|
||
|
|
||
|
- name: Install Task
|
||
|
uses: arduino/setup-task@v1
|
||
|
with:
|
||
|
version: '3.x' # If available, use the latest major version that's compatible
|
||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||
|
|
||
|
- name: Docker Operations
|
||
|
run: |
|
||
|
sudo docker compose up -d
|
||
4 months ago
|
sudo bash bootstrap.sh
|
||
|
sudo mage
|
||
9 months ago
|
sudo sleep 20
|
||
10 months ago
|
|
||
|
- name: Module Operations
|
||
|
run: |
|
||
4 months ago
|
echo "===========> Verifying go-gitlint is installed"
|
||
|
if [ ! -f ./_output/tools/go-gitlint ]; then
|
||
|
export GOBIN=$(pwd)/_output/tools
|
||
|
echo "===========> Installing The default installation path is /home/ubuntu/DF/open-im-server/_output/tools/go-gitlint"
|
||
|
sudo go install github.com/marmotedu/go-gitlint/cmd/go-gitlint@latest
|
||
|
echo "===========> go-gitlint is installed in /home/ubuntu/DF/open-im-server/_output/tools/go-gitlint"
|
||
|
fi
|
||
|
|
||
5 months ago
|
- name: Build, Start(make build && make start)
|
||
10 months ago
|
run: |
|
||
|
sudo ./scripts/install/install.sh -i
|
||
|
|
||
|
- name: Exec OpenIM System Status Chack
|
||
|
run: |
|
||
|
sudo ./scripts/install/install.sh -s
|
||
|
|
||
4 months ago
|
# - name: Exec OpenIM API test (make test-api)
|
||
|
- name: Exec OpenIM test (make test)
|
||
10 months ago
|
run: |
|
||
8 months ago
|
mkdir -p ./tmp
|
||
|
touch ./tmp/test.md
|
||
|
echo "# OpenIM Test" >> ./tmp/test.md
|
||
|
echo "## OpenIM API Test" >> ./tmp/test.md
|
||
|
echo "<details><summary>Command Output for OpenIM API Test</summary>" >> ./tmp/test.md
|
||
|
echo "<pre><code>" >> ./tmp/test.md
|
||
4 months ago
|
echo "===========> Run api test"
|
||
|
./scripts/install/test.sh
|
||
|
echo "===========> Run api test" >> ./tmp/test.md
|
||
|
./scripts/install/test.sh >> ./tmp/test.md
|
||
8 months ago
|
echo "</code></pre>" >> ./tmp/test.md
|
||
|
echo "</details>" >> ./tmp/test.md
|
||
8 months ago
|
|
||
4 months ago
|
echo "===========> Run api test"
|
||
|
./scripts/install/test.sh
|
||
5 months ago
|
|
||
4 months ago
|
# - name: Exec OpenIM E2E Test (make test-e2e)
|
||
|
# run: |
|
||
|
# echo "" >> ./tmp/test.md
|
||
|
# echo "## OpenIM E2E Test" >> ./tmp/test.md
|
||
|
# echo "<details><summary>Command Output for OpenIM E2E Test</summary>" >> ./tmp/test.md
|
||
|
# echo "<pre><code>" >> ./tmp/test.md
|
||
|
# sudo make test-e2e | tee -a ./tmp/test.md
|
||
|
# echo "</code></pre>" >> ./tmp/test.md
|
||
|
# echo "</details>" >> ./tmp/test.md
|
||
8 months ago
|
|
||
4 months ago
|
# sudo make test-e2e
|
||
5 months ago
|
|
||
8 months ago
|
- name: Comment PR with file
|
||
|
uses: thollander/actions-comment-pull-request@v2
|
||
|
with:
|
||
8 months ago
|
filePath: ./tmp/test.md
|
||
8 months ago
|
comment_tag: nrt_file
|
||
|
reactions: eyes, rocket
|
||
|
mode: recreate
|
||
|
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||
|
continue-on-error: true
|
||
|
|
||
|
- name: Check outputs
|
||
|
run: |
|
||
|
echo "id : ${{ steps.nrt_message.outputs.id }}"
|
||
|
echo "body : ${{ steps.nrt_message.outputs.body }}"
|
||
|
echo "html_url : ${{ steps.nrt_message.outputs.html_url }}"
|
||
10 months ago
|
|
||
|
- name: Exec OpenIM System uninstall
|
||
|
run: |
|
||
9 months ago
|
sudo ./scripts/install/install.sh -u
|
||
|
|
||
|
- name: gobenchdata publish
|
||
|
uses: bobheadxi/gobenchdata@v1
|
||
|
with:
|
||
|
PRUNE_COUNT: 30
|
||
|
GO_TEST_FLAGS: -cpu 1,2
|
||
|
PUBLISH: true
|
||
|
PUBLISH_BRANCH: gh-pages
|
||
|
env:
|
||
|
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||
5 months ago
|
continue-on-error: true
|