-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into stubsabot/protobuf
- Loading branch information
Showing
536 changed files
with
8,854 additions
and
2,742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Third-party stubtest | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'stubs/**' | ||
- '.github/workflows/stubtest_third_party.yml' | ||
- 'tests/**' | ||
# When requirements.txt changes, we run `daily.yml`, which includes third-party stubtest | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
stubtest-third-party: | ||
name: Check third party stubs with stubtest | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements-tests.txt | ||
stubs/**/@tests/requirements-stubtest.txt | ||
stubs/**/METADATA.toml | ||
- name: Install dependencies | ||
run: pip install -r requirements-tests.txt | ||
- name: Run stubtest | ||
shell: bash | ||
run: | | ||
# This only runs stubtest on changed stubs, because it is much faster. | ||
# Use the daily.yml workflow to run stubtest on all third party stubs. | ||
function find_stubs { | ||
git diff --name-only origin/${{ github.base_ref }} HEAD | \ | ||
egrep ^stubs/ | cut -d "/" -f 2 | sort -u | \ | ||
(while read stub; do [ -d "stubs/$stub" ] && echo "$stub" || true; done) | ||
} | ||
STUBS=$(find_stubs || echo '') | ||
if [ -n "$STUBS" ]; then | ||
echo "Testing $STUBS..." | ||
PACKAGES=$(python tests/get_packages.py $STUBS) | ||
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; 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 | ||
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 [ "${{ 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 | ||
echo "Nothing to test" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.