Skip to content

Commit

Permalink
refactor: Update echo server build process and log handling
Browse files Browse the repository at this point in the history
This commit updates the echo server build process in the tests.yml file. It modifies the command to redirect the server logs to a separate file called echo.log. Additionally, it saves the process ID of the echo server to echo_pid.txt for later use. This change improves the logging and ensures better management of the echo server process.
  • Loading branch information
PlugFox committed Jul 19, 2024
1 parent 0d4fb67 commit 7de02ec
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ jobs:
id: run-echo-server
timeout-minutes: 1
run: |
nohup ~/build/bin/echo > /dev/null 2>&1 &
nohup ~/build/bin/echo > echo.log 2>&1 &
echo $! > echo_pid.txt
env:
PORT: 8000

Expand All @@ -169,12 +170,25 @@ jobs:
--timeout=10m --concurrency=12 --color \
test/unit_test.dart test/smoke_test.dart
- name: ⛔ Stop Go server
- name: 🧾 Upload echo logs
id: upload-echo-logs
if: always()
uses: actions/upload-artifact@v4
with:
name: server-logs
path: echo.log
compression-level: 9
overwrite: true
retention-days: 1

- name: ⛔ Stop echo server
id: stop-echo-server
timeout-minutes: 1
if: always()
run: |
kill $(lsof -t -i:8000)
kill $(cat echo_pid.txt) || true
rm -f echo_pid.txt || true
rm -f echo.log || true
- name: 🧹 Cleanup artifacts
id: cleanup-artifacts
Expand Down

0 comments on commit 7de02ec

Please sign in to comment.