From 9a4f59c459ce9586d08b1b8903cd54132fcd8fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 13 Mar 2023 12:15:12 -0400 Subject: [PATCH 1/4] CI: run nightly tests only on main --- .github/workflows/optional.yml | 38 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 37 --------------------------------- 2 files changed, 38 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/optional.yml diff --git a/.github/workflows/optional.yml b/.github/workflows/optional.yml new file mode 100644 index 000000000..c270cbe78 --- /dev/null +++ b/.github/workflows/optional.yml @@ -0,0 +1,38 @@ +name: 'Optional' + +on: + [push, workflow_dispatch] + + +jobs: + nightly: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + + - name: Install project dependencies + uses: ./.github/setup + with: + os: ubuntu-latest + python-version: '3.10' + + - name: Run pytest (against pandas nightly) + run: poetry run poe pytest --nightly + + mypy_nightly: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@v3 + + - name: Install project dependencies + uses: ./.github/setup + with: + os: ubuntu-latest + python-version: '3.10' + + - name: Run mypy tests with mypy nightly + run: poetry run poe mypy --mypy_nightly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9d41972a7..a3b4643a8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,11 +25,6 @@ jobs: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} - - name: Show poetry python location (Windows) - shell: pwsh - run: poetry run where python - if: matrix.os == 'windows-latest' - - name: Run mypy on 'tests' (using the local stubs) and on the local stubs run: poetry run poe mypy @@ -42,22 +37,6 @@ jobs: - name: Install pandas-stubs and run tests on the installed stubs run: poetry run poe test_dist - nightly: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v3 - - - name: Install project dependencies - uses: ./.github/setup - with: - os: ubuntu-latest - python-version: '3.10' - - - name: Run pytest (against pandas nightly) - run: poetry run poe pytest --nightly - precommit: runs-on: ubuntu-latest timeout-minutes: 10 @@ -66,19 +45,3 @@ jobs: - uses: actions/checkout@v3 - uses: pre-commit/action@v3.0.0 - - mypy_nightly: - runs-on: ubuntu-latest - timeout-minutes: 10 - - steps: - - uses: actions/checkout@v3 - - - name: Install project dependencies - uses: ./.github/setup - with: - os: ubuntu-latest - python-version: '3.10' - - - name: Run mypy tests with mypy nightly - run: poetry run poe mypy --mypy_nightly From b46078d1143d927629eb7b1f51aa68516e543254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 13 Mar 2023 16:12:44 -0400 Subject: [PATCH 2/4] avoid running optional tests on forks --- .github/workflows/optional.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/optional.yml b/.github/workflows/optional.yml index c270cbe78..584706e61 100644 --- a/.github/workflows/optional.yml +++ b/.github/workflows/optional.yml @@ -6,6 +6,7 @@ on: jobs: nightly: + if: ${{ github.repository == 'pandas-dev/pandas-stubs' }} runs-on: ubuntu-latest timeout-minutes: 10 @@ -22,6 +23,7 @@ jobs: run: poetry run poe pytest --nightly mypy_nightly: + if: ${{ github.repository == 'pandas-dev/pandas-stubs' }} runs-on: ubuntu-latest timeout-minutes: 10 From 0455548cedc7ce940c09e2f42c98e316fd3da9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 13 Mar 2023 16:20:28 -0400 Subject: [PATCH 3/4] test --- .github/workflows/optional.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/optional.yml b/.github/workflows/optional.yml index 584706e61..acf015c90 100644 --- a/.github/workflows/optional.yml +++ b/.github/workflows/optional.yml @@ -1,12 +1,13 @@ name: 'Optional' on: - [push, workflow_dispatch] - + push: + branches: + - main + workflow_dispatch: jobs: nightly: - if: ${{ github.repository == 'pandas-dev/pandas-stubs' }} runs-on: ubuntu-latest timeout-minutes: 10 @@ -23,7 +24,6 @@ jobs: run: poetry run poe pytest --nightly mypy_nightly: - if: ${{ github.repository == 'pandas-dev/pandas-stubs' }} runs-on: ubuntu-latest timeout-minutes: 10 From 23ca66ced3089659e38ab86a8baffe7eab58086a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Mon, 13 Mar 2023 16:22:38 -0400 Subject: [PATCH 4/4] skip normal tests on non-main branches --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a3b4643a8..4a3b7ee64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,11 @@ name: 'Test' on: - [push, pull_request, workflow_dispatch] + push: + branches: + - main + pull_request: + workflow_dispatch: env: MPLBACKEND: 'Agg'