|
| 1 | +name: Python CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + pull_request: |
| 8 | + types: ['opened', 'reopened', 'synchronize'] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +jobs: |
| 15 | + lint: |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + strategy: |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: [ "ubuntu-latest" ] |
| 21 | + python-version: [ "3.10" ] |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Check out code |
| 25 | + uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + submodules: recursive |
| 29 | + - name: Set up Python environment |
| 30 | + uses: actions/setup-python@v4 |
| 31 | + with: |
| 32 | + python-version: "3.10" |
| 33 | + - name: flake8 Lint |
| 34 | + uses: py-actions/flake8@v2 |
| 35 | + with: |
| 36 | + path: "xorbits_sql" |
| 37 | + args: "--config setup.cfg" |
| 38 | + - name: black |
| 39 | + uses: psf/black@stable |
| 40 | + with: |
| 41 | + src: "xorbits_sql" |
| 42 | + options: "--check" |
| 43 | + - uses: isort/isort-action@master |
| 44 | + with: |
| 45 | + sortPaths: "xorbits_sql" |
| 46 | + configuration: "--check-only --diff --sp setup.cfg" |
| 47 | + - name: mypy |
| 48 | + run: pip install mypy && mypy xorbits_sql |
| 49 | + - name: codespell |
| 50 | + run: pip install codespell && codespell xorbits_sql |
| 51 | + |
| 52 | + build_test_job: |
| 53 | + runs-on: ${{ matrix.os }} |
| 54 | + needs: lint |
| 55 | + env: |
| 56 | + CONDA_ENV: xorbits_sql-test |
| 57 | + defaults: |
| 58 | + run: |
| 59 | + shell: bash -l {0} |
| 60 | + strategy: |
| 61 | + fail-fast: false |
| 62 | + matrix: |
| 63 | + os: ["ubuntu-latest", "macos-latest", "windows-latest"] |
| 64 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 65 | + module: ["xorbits_sql"] |
| 66 | + exclude: |
| 67 | + - { os: macos-latest, python-version: 3.9 } |
| 68 | + - { os: macos-latest, python-version: 3.10 } |
| 69 | + - { os: windows-latest, python-version: 3.9 } |
| 70 | + - { os: windows-latest, python-version: 3.10 } |
| 71 | + |
| 72 | + steps: |
| 73 | + - name: Check out code |
| 74 | + uses: actions/checkout@v3 |
| 75 | + with: |
| 76 | + fetch-depth: 0 |
| 77 | + submodules: recursive |
| 78 | + |
| 79 | + - name: Set up conda ${{ matrix.python-version }} |
| 80 | + uses: conda-incubator/setup-miniconda@v2 |
| 81 | + with: |
| 82 | + python-version: ${{ matrix.python-version }} |
| 83 | + activate-environment: ${{ env.CONDA_ENV }} |
| 84 | + |
| 85 | + - name: Install dependencies |
| 86 | + env: |
| 87 | + MODULE: ${{ matrix.module }} |
| 88 | + run: | |
| 89 | + pip install cython coverage flaky |
| 90 | + pip install -e ".[dev]" |
| 91 | + working-directory: . |
| 92 | + |
| 93 | + - name: Test with pytest |
| 94 | + env: |
| 95 | + MODULE: ${{ matrix.module }} |
| 96 | + run: | |
| 97 | + pytest --cov-config=setup.cfg --cov-report=xml --cov=xorbits_sql --durations=0 \ |
| 98 | + --log-level=DEBUG --timeout=200 xorbits_sql |
| 99 | + working-directory: . |
| 100 | + |
| 101 | + - name: Report coverage data |
| 102 | + uses: codecov/codecov-action@v3 |
| 103 | + with: |
| 104 | + working-directory: . |
| 105 | + flags: unittests |
0 commit comments