From 7be38d332f30f1c05e15a27303328d708e31ee4b Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw)" <3293172751nss@gmail.com> Date: Tue, 7 Nov 2023 05:58:39 +0800 Subject: [PATCH] feat: add openim e2e test Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --- .github/workflows/api-test.yml | 53 +++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/api-test.yml b/.github/workflows/api-test.yml index 6c71ea1a8..d03f0a139 100644 --- a/.github/workflows/api-test.yml +++ b/.github/workflows/api-test.yml @@ -22,4 +22,55 @@ env: GO_VERSION: "1.19" GOLANGCI_VERSION: "v1.50.1" -jobs: \ No newline at end of file +jobs: + 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 }} + uses: actions/setup-go@v4 + 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: | + curl -o docker-compose.yml https://raw.githubusercontent.com/OpenIMSDK/openim-docker/main/example/basic-openim-server-dependency.yml + sudo docker compose up -d + sudo sleep 60 + + - name: Module Operations + run: | + sudo make tidy + sudo make tools.verify.go-gitlint + + - name: Build, Start, Check Services and Print Logs + run: | + sudo ./scripts/install/install.sh -i && \ + sudo ./scripts/install/install.sh -s && \ + (echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null) + + - name: Run Test + run: | + sudo make test-api && \ + (echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null) + + - name: Stop Services + run: | + sudo ./scripts/install/install.sh -u && \ + (echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null) \ No newline at end of file