Skip to content

Commit

Permalink
Update workflow --filter=[framework][core] --valgrind
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Aug 16, 2024
1 parent fb78cf8 commit 328d3ee
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[core]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[core]')"
services:
tinyproxy:
image: "vimagick/tinyproxy"
Expand Down Expand Up @@ -37,12 +37,15 @@ jobs:
make VERBOSE=1 -j &&
sudo make install

- name: install valgrind
run: sudo apt install -y valgrind
- name: make test with valgrind
if: "contains(github.event.head_commit.message, '--valgrind')"
run:
sudo apt install -y valgrind
cd core-tests && SWOOLE_VALGRIND=1 ./run.sh

- name: make test
run:
cd core-tests && valgrind ./run.sh
cd core-tests && ./run.sh

- name: run coverage
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:

jobs:
build-ubuntu-latest:
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[ext]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[ext]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
jobs:
linux:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[framework]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[framework]')"
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iouring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
test-linux:
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[iouring]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[iouring]')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
test-linux:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[thread]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[thread]')"
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
test-linux:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[unit]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[unit]')"
strategy:
fail-fast: false
matrix:
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Run pecl-install.sh
run: |
sudo ${{runner.workspace}}/swoole-src/scripts/pecl-install.sh
- name: Run Swoole test
- name: Run unit tests
run: |
export SWOOLE_BRANCH=${GITHUB_REF##*/}
export SWOOLE_BUILD_DIR=$(realpath .)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/xdebug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
tests:
if: "!contains(github.event.head_commit.message, '[workflow-filter]') || contains(github.event.head_commit.message, '[xdebug]')"
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[xdebug]')"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
11 changes: 9 additions & 2 deletions core-tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@ ipcs -q

tasks=$(./bin/core_tests --gtest_list_tests | awk '/\./')
for task in $tasks; do

if [ "${SWOOLE_VALGRIND}" = 1 ]; then
execute_command="valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./bin/core_tests"
else
execute_command="./bin/core_tests"
fi

if [ $task = "log." ]; then
./bin/core_tests --gtest_filter=$task*
$execute_command --gtest_filter=$task*
else
sudo ./bin/core_tests --gtest_filter=$task*
sudo $execute_command --gtest_filter=$task*
fi

if [ $? -ne 0 ] && [ "${GITHUB_ACTIONS}" = true ]; then
Expand Down

0 comments on commit 328d3ee

Please sign in to comment.