diff --git a/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml b/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml index 82de046..5f63186 100644 --- a/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml +++ b/template/py/{{cookiecutter.project_slug}}/.github/workflows/ci.yml @@ -7,43 +7,45 @@ on: pull_request: workflow_dispatch: -{% raw %} jobs: - build-and-test: - name: python-${{ matrix.os }} + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up UV Environment + uses: astral-sh/setup-uv@v3 + with: + version: "latest" + + - name: Format Code + run: uvx ruff format --diff . + + - name: Lint Code + run: uvx ruff check . + build-and-test: + runs-on: {{ "${{ matrix.os }}" }} strategy: matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - + os: [ubuntu-latest, macos-latest, windows-latest] fail-fast: false - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up uv - if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }} - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Set up UV Environment + uses: astral-sh/setup-uv@v3 + with: + version: "latest" - - name: Set up uv - if: ${{ matrix.os == 'windows-latest' }} - run: irm https://astral.sh/uv/install.ps1 | iex - shell: powershell + - name: Synchronize Dependencies + run: uv sync - - name: Format - run: uvx ruff format --diff . - - - name: Lint - run: uvx ruff check . + - name: Build Project + run: uvx hatch build - - name: Build & Test - run: | - uv sync - uvx hatch build - uvx hatch test -{% endraw -%} + - name: Run Tests + run: uvx hatch test