From d7a701372d22fb65070a1a6650ed926ff8fd3a64 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:07:34 -0700 Subject: [PATCH] Run stub_uploader tests in CI (#8794) --- .github/workflows/daily.yml | 33 ++++++++++++++++++++++++++++----- .github/workflows/tests.yml | 25 ++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 080982f39..6dace9482 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -58,12 +58,35 @@ jobs: - name: Run stubtest run: xvfb-run python tests/stubtest_third_party.py --num-shards 4 --shard-index ${{ matrix.shard-index }} + stub-uploader: + name: Run the stub_uploader tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Checkout typeshed + uses: actions/checkout@v3 + with: + path: typeshed + - name: Checkout stub_uploader + uses: actions/checkout@v3 + with: + repository: typeshed-internal/stub_uploader + path: stub_uploader + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Run tests + run: | + cd stub_uploader + pip install -r requirements.txt + python -m pytest tests + # https://github.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2 create-issue-on-failure: - name: Create an issue if stubtest failed + name: Create an issue if daily tests failed runs-on: ubuntu-latest - needs: [stubtest-stdlib, stubtest-third-party] - if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure') }} + needs: [stubtest-stdlib, stubtest-third-party, stub-uploader] + if: ${{ github.repository == 'python/typeshed' && always() && (needs.stubtest-stdlib.result == 'failure' || needs.stubtest-third-party.result == 'failure' || needs.stub-uploader.result == 'failure') }} permissions: issues: write steps: @@ -74,7 +97,7 @@ jobs: await github.rest.issues.create({ owner: "python", repo: "typeshed", - title: `Stubtest failed on ${new Date().toDateString()}`, - body: "Stubtest runs are listed here: https://github.com/python/typeshed/actions/workflows/daily.yml", + title: `Daily tests failed on ${new Date().toDateString()}`, + body: "Runs listed here: https://github.com/python/typeshed/actions/workflows/daily.yml", labels: ["help wanted"], }) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c49dc005b..337e75d80 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,7 +93,7 @@ jobs: - run: python ./tests/regr_test.py --all pyright: - name: Test the stubs with pyright + name: Test typeshed with pyright runs-on: ubuntu-latest strategy: matrix: @@ -125,6 +125,29 @@ jobs: python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. + stub-uploader: + name: Run the stub_uploader tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Checkout typeshed + uses: actions/checkout@v3 + with: + path: typeshed + - name: Checkout stub_uploader + uses: actions/checkout@v3 + with: + repository: typeshed-internal/stub_uploader + path: stub_uploader + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Run tests + run: | + cd stub_uploader + pip install -r requirements.txt + python -m pytest tests + stubtest-third-party: name: Check third party stubs with stubtest runs-on: ubuntu-20.04