Deduplicate stubtest command in actions (#9444)

This commit is contained in:
Avasam
2023-01-02 17:19:47 -05:00
committed by GitHub
parent feb9b2dc9f
commit 4a7e14e5ad
2 changed files with 7 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ jobs:
sudo apt update && sudo apt install -y $PACKAGES
fi
xvfb-run python tests/stubtest_third_party.py --specified-stubs-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
PYTHON_EXECUTABLE="xvfb-run python"
else
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
NONINTERACTIVE=1 brew install $PACKAGES
@@ -88,9 +88,10 @@ jobs:
choco install -y $PACKAGES
fi
python tests/stubtest_third_party.py --specified-stubs-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
PYTHON_EXECUTABLE="python"
fi
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-stubs-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
stub-uploader:
name: Run the stub_uploader tests
runs-on: ubuntu-latest

View File

@@ -66,7 +66,7 @@ jobs:
sudo apt update && sudo apt install -y $PACKAGES
fi
xvfb-run python tests/stubtest_third_party.py --specified-stubs-only $STUBS
PYTHON_EXECUTABLE="xvfb-run python"
else
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
echo "Installing Homebrew packages: $PACKAGES"
@@ -78,8 +78,10 @@ jobs:
choco install -y $PACKAGES
fi
python tests/stubtest_third_party.py --specified-stubs-only $STUBS
PYTHON_EXECUTABLE="python"
fi
$PYTHON_EXECUTABLE tests/stubtest_third_party.py --specified-stubs-only $STUBS
else
echo "Nothing to test"
fi