Add support for Homebrew and Chocolatey (#9187)

This commit is contained in:
Avasam
2022-11-24 02:17:17 -05:00
committed by GitHub
parent 67c8b5cb22
commit 7050c1d907
8 changed files with 63 additions and 22 deletions

View File

@@ -69,12 +69,23 @@ jobs:
- name: Run stubtest
shell: bash
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt update
sudo apt install -y $(python tests/get_packages.py)
PACKAGES=$(python tests/get_packages.py)
if [ "${{ runner.os }}" = "Linux" ]; then
if [ -n "$PACKAGES" ]; then
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 }}
else
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
NONINTERACTIVE=1 brew install $PACKAGES
fi
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
choco install -y $PACKAGES
fi
python tests/stubtest_third_party.py --specified-stubs-only --num-shards 4 --shard-index ${{ matrix.shard-index }}
fi

View File

@@ -58,21 +58,24 @@ jobs:
echo "Testing $STUBS..."
PACKAGES=$(python tests/get_packages.py $STUBS)
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
if [ "${{ runner.os }}" = "Linux" ]; then
if [ -n "$PACKAGES" ]; then
echo "Installing apt packages: $PACKAGES"
sudo apt update && sudo apt install -y $PACKAGES
fi
xvfb-run python tests/stubtest_third_party.py --specified-stubs-only $STUBS
fi
else
if [ "${{ runner.os }}" = "macOS" ] && [ -n "$PACKAGES" ]; then
echo "Installing Homebrew packages: $PACKAGES"
NONINTERACTIVE=1 brew install $PACKAGES
fi
if [ "${{ matrix.os }}" = "macos-latest" ]; then
# Could install brew packages here if we run into stubs that need it
python tests/stubtest_third_party.py --specified-stubs-only $STUBS
fi
if [ "${{ runner.os }}" = "Windows" ] && [ -n "$PACKAGES" ]; then
echo "Installing Chocolatey packages: $PACKAGES"
choco install -y $PACKAGES
fi
if [ "${{ matrix.os }}" = "windows-latest" ]; then
# Could install choco packages here if we run into stubs that need it
python tests/stubtest_third_party.py --specified-stubs-only $STUBS
fi
else