Merge pull request #128 from kbase/make_ncbi_api_more_tenacious #555
This file contains hidden or 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
| name: Run tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| jobs: | |
| code_format_and_lint: | |
| name: Check code formatting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/[email protected] | |
| with: | |
| enable-cache: true | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Run code formatting checks | |
| shell: bash | |
| run: uv run ruff format --check | |
| - name: Run code linting checks | |
| continue-on-error: true | |
| run: uv run ruff check --output-format=github . | |
| spark_tests: | |
| name: Run container tests | |
| needs: code_format_and_lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Run spark tests | |
| shell: bash | |
| continue-on-error: false | |
| run: | | |
| docker pull ghcr.io/berdatalakehouse/spark_notebook:main | |
| echo "Running tests inside container..." | |
| # slightly nasty hack | |
| chmod 777 . | |
| docker run --rm -e NB_USER=runner -v .:/tmp/cdm ghcr.io/berdatalakehouse/spark_notebook:main /bin/bash /tmp/cdm/scripts/run_tests.sh | |
| - name: Send to Codecov | |
| id: send_to_codecov | |
| uses: codecov/[email protected] | |
| with: | |
| files: coverage.xml | |
| # fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| tests: | |
| name: Run local tests (${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: code_format_and_lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13", "3.14"] | |
| os: ["ubuntu-24.04"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/[email protected] | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --dev | |
| - name: Run local tests | |
| shell: bash | |
| continue-on-error: false | |
| run: uv run pytest -m "not requires_spark" |