Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

CI: allow lint and short tests for everyone #695

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 37 additions & 21 deletions .github/workflows/check-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
steps:
- run: echo ✓
check:
needs: authorize
name: Check
runs-on: ubuntu-latest
steps:
Expand All @@ -49,8 +48,8 @@ jobs:
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install -U pre-commit tox
- run: SKIP=pylint pre-commit run -a --show-diff-on-failure
test:
needs: authorize
test-short:
needs: check
name: Test ${{ matrix.os }} with py${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -91,6 +90,40 @@ jobs:
pip install pre-commit .[tests]
- if: contains(matrix.os, 'ubuntu') && matrix.python == '3.10'
run: pre-commit run pylint -a -v --show-diff-on-failure
- name: Run short tests
timeout-minutes: 40
run: pytest -k 'not heroku and not flyio'
env:
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_MATRIX_OS: ${{ matrix.os }}
GITHUB_MATRIX_PYTHON: ${{ matrix.python }}
BITBUCKET_USERNAME: ${{ secrets.BITBUCKET_USERNAME }}
BITBUCKET_PASSWORD: ${{ secrets.BITBUCKET_PASSWORD }}
Comment on lines +97 to +104
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, initial idea was to allow external contributors to run tests that don't require using secrets #330 #318. But here you do exactly opposite, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to recall how we ended up with this authorize step, and IIRC, it was the case that CI/CD doesn't run for external contributors at all because GH doesn't allow them to use secrets we put to the repo. If that's true, we need to actually separate tests to two parts: one that requires secrets, and the other that doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should've moved this back to draft, my bad sorry. I moved attention elsewhere but I'll catch up with you again before coming back to this.

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
test-framework:
needs: [authorize, test-short]
name: Test ${{ matrix.os }} with py${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python: ["3.8", "3.9", "3.10"]
exclude:
# no HDF5 support installed for tables
- os: windows-latest
python: "3.9"
# catboost building problems
- os: macos-latest
python: "3.8"
fail-fast: false
steps:
- name: Run Heroku tests
if: |
contains(matrix.os, 'ubuntu') &&
Expand All @@ -113,26 +146,9 @@ jobs:
- name: Start minikube
if: contains(matrix.os, 'ubuntu') && matrix.python == '3.9'
uses: medyagh/setup-minikube@master
- name: Run tests
timeout-minutes: 40
run: pytest -k 'not heroku and not flyio'
env:
GITHUB_USERNAME: ${{ secrets.GH_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_MATRIX_OS: ${{ matrix.os }}
GITHUB_MATRIX_PYTHON: ${{ matrix.python }}
BITBUCKET_USERNAME: ${{ secrets.BITBUCKET_USERNAME }}
BITBUCKET_PASSWORD: ${{ secrets.BITBUCKET_PASSWORD }}
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
deploy:
name: PyPI Deploy
needs: [check, test]
needs: [check, test-short, test-framework]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down