refactor: remove batchListener. #260
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go Build Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
go-build: | |
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
# pull-requests: write | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
go_version: ["1.21.x", "1.22.x"] | |
steps: | |
- name: Checkout Server repository | |
uses: actions/checkout@v4 | |
- name: Set up Go ${{ matrix.go_version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go_version }} | |
- name: Build test SDK core | |
run: | | |
go mod tidy | |
go generate ./... | |
cd wasm/cmd && make wasm | |
# TODO: add coverage test | |
go-test: | |
name: Benchmark Test with go ${{ matrix.go_version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
env: | |
SERVER_DIR: open-im-server | |
CONFIG_PATH: config/notification.yml | |
# pull-requests: write | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
go_version: [ "1.22.x" ] | |
steps: | |
- name: Checkout SDK repository | |
uses: actions/checkout@v4 | |
- name: Checkout Server repository | |
uses: actions/checkout@v4 | |
with: | |
repository: 'openimsdk/open-im-server' | |
path: ${{ env.SERVER_DIR }} | |
- name: Set up Go ${{ matrix.go_version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go_version }} | |
- name: Get Server dependencies | |
run: | | |
cd ${{ env.SERVER_DIR }} | |
go install github.com/magefile/mage@latest | |
go mod download | |
- name: Install yq | |
run: | | |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -O /usr/bin/yq | |
sudo chmod +x /usr/bin/yq | |
- name: Modify Server Configuration | |
run: | | |
cd ${{ env.SERVER_DIR }} | |
yq e '.groupCreated.unreadCount = true' -i ${{ env.CONFIG_PATH }} | |
yq e '.friendApplicationApproved.unreadCount = true' -i ${{ env.CONFIG_PATH }} | |
- name: Start Server Services | |
run: | | |
cd ${{ env.SERVER_DIR }} | |
docker compose up -d | |
mage build | |
mage start | |
mage check | |
- name: Build test SDK core | |
run: | | |
go mod tidy | |
cd integration_test | |
mkdir data | |
go run main.go -lgr 0.8 -imf -crg -ckgn -ckcon -sem -ckmsn -u 20 -su 5 -lg 2 -cg 2 -cgm 3 -sm 10 -gm 10 -reg | |
# - name: Stop Server | |
# run: | | |
# cd ${{ github.workspace }}/open-im-server | |
# mage stop | |
# dockerfile-test: | |
# name: Build and Test Dockerfile | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# go_version: ["1.21"] | |
# steps: | |
# - name: Checkout Repository | |
# uses: actions/checkout@v4 | |
# - name: Set up Go ${{ matrix.go_version }} | |
# uses: actions/setup-go@v5 | |
# with: | |
# go-version: ${{ matrix.go_version }} | |
# - name: Get dependencies | |
# run: | | |
# go mod tidy | |
# go mod download | |
# go install github.com/magefile/mage@latest | |
# - name: Build Docker Image | |
# run: | | |
# IMAGE_NAME="${{ github.event.repository.name }}-test" | |
# CONTAINER_NAME="${{ github.event.repository.name }}-container" | |
# docker build -t $IMAGE_NAME . | |
# - name: Run Docker Container | |
# run: | | |
# IMAGE_NAME="${{ github.event.repository.name }}-test" | |
# CONTAINER_NAME="${{ github.event.repository.name }}-container" | |
# docker run --name $CONTAINER_NAME -d $IMAGE_NAME | |
# docker ps -a | |
# - name: Test Docker Container Logs | |
# run: | | |
# CONTAINER_NAME="${{ github.event.repository.name }}-container" | |
# docker logs $CONTAINER_NAME | |
# # - name: Cleanup Docker Container | |
# # run: | | |
# # CONTAINER_NAME="${{ github.event.repository.name }}-container" | |
# # IMAGE_NAME="${{ github.event.repository.name }}-test" | |
# # docker stop $CONTAINER_NAME | |
# # docker rm $CONTAINER_NAME | |
# # docker rmi $IMAGE_NAME |