Skip to content

Commit

Permalink
refactor: refine CI pipeline (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn authored Oct 8, 2024
1 parent 609339f commit 936b92d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build_linux_ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
fetch-depth: "0"
submodules: "true"

- name: Install cpulimit and taskset
run: |
apt-get update
apt-get install -y cpulimit util-linux
- name: Build
run: |
export PATH=$(pwd)/core/ten_gn/:$PATH
Expand All @@ -50,14 +55,34 @@ jobs:
tgn build linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out
- name: Create cmd_wrapper.sh
run: |
echo '#!/bin/sh' > cmd_wrapper.sh
echo 'echo "==========================================="' >> cmd_wrapper.sh
echo 'echo "cmd wrapper executes the following command:"' >> cmd_wrapper.sh
echo 'echo "$@"' >> cmd_wrapper.sh
echo 'echo "==========================================="' >> cmd_wrapper.sh
echo '"$@"' >> cmd_wrapper.sh
echo 'status=$?' >> cmd_wrapper.sh
echo 'echo $status >_cmd_wrapper_exit_status.txt' >> cmd_wrapper.sh
echo 'exit $status' >> cmd_wrapper.sh
shell: bash

- name: Run Tests
run: |
chmod +x cmd_wrapper.sh
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
- name: Upload ten_packages
uses: actions/upload-artifact@v3
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build_linux_ubuntu2204.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
fetch-depth: "0"
submodules: "true"

- name: Install cpulimit and taskset
run: |
apt-get update
apt-get install -y cpulimit util-linux
- name: Build
run: |
export PATH=$(pwd)/core/ten_gn:$PATH
Expand All @@ -50,14 +55,34 @@ jobs:
tgn build linux x64 ${{ matrix.build_type }}
tree -I 'gen|obj' out
- name: Create cmd_wrapper.sh
run: |
echo '#!/bin/sh' > cmd_wrapper.sh
echo 'echo "==========================================="' >> cmd_wrapper.sh
echo 'echo "cmd wrapper executes the following command:"' >> cmd_wrapper.sh
echo 'echo "$@"' >> cmd_wrapper.sh
echo 'echo "==========================================="' >> cmd_wrapper.sh
echo '"$@"' >> cmd_wrapper.sh
echo 'status=$?' >> cmd_wrapper.sh
echo 'echo $status >_cmd_wrapper_exit_status.txt' >> cmd_wrapper.sh
echo 'exit $status' >> cmd_wrapper.sh
shell: bash

- name: Run Tests
run: |
chmod +x cmd_wrapper.sh
chmod +x out/linux/x64/tests/standalone/ten_utils_unit_test
out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_utils_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_unit_test
out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_unit_test
chmod +x out/linux/x64/tests/standalone/ten_runtime_smoke_test
out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 60 -- taskset 0x3 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
cpulimit -f -l 30 -- taskset 0x1 ./cmd_wrapper.sh out/linux/x64/tests/standalone/ten_runtime_smoke_test
- name: Upload tman
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 936b92d

Please sign in to comment.