Merge pull request #200 from galaxyproject/coc #697
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: tests | |
| # Run this workflow every time a new commit pushed to your repository | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| # Set the job key. The key is displayed as the job name | |
| # when a job name is not provided | |
| lint: | |
| name: lint code | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ '3.10' ] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Cache uv dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-lint | |
| - name: Cache tox dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: .tox | |
| key: tox-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-lint | |
| - name: Run tox | |
| run: uvx --with tox-uv tox -e lint | |
| mypy: | |
| # Name the Job | |
| name: mypy type checks | |
| # Set the type of machine to run on | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Cache uv dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-py310 | |
| - name: Cache tox dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: .tox | |
| key: tox-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-py310 | |
| - name: Run tox | |
| run: uvx --with tox-uv tox -e mypy | |
| py310: | |
| # Name the Job | |
| name: tox tests | |
| needs: [lint, mypy] | |
| # Set the type of machine to run on | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Cache uv dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-py310 | |
| - name: Cache tox dir | |
| uses: actions/cache@v4 | |
| with: | |
| path: .tox | |
| key: tox-cache-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/setup.py', '**/requirements.txt', '**/requirements_test.txt', '**/tox.ini') }}-py310 | |
| - name: Run tox | |
| run: uvx --with tox-uv tox -e py${{ matrix.python-version }} | |
| env: | |
| PYTHONUNBUFFERED: "True" | |
| - name: Coveralls | |
| uses: AndreMiras/coveralls-python-action@develop | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| flag-name: run-${{ matrix.python-version }} |