diff --git a/.github/workflows/check-sources.yml b/.github/workflows/check-sources.yml index 37cbc9e..2284d99 100644 --- a/.github/workflows/check-sources.yml +++ b/.github/workflows/check-sources.yml @@ -45,49 +45,15 @@ jobs: with: python-version: "3.11" cache: "pip" + - name: Install uv + uses: astral-sh/setup-uv@v4 - name: ๐Ÿ› ๏ธ Install development tools and dependencies - run: | - pip install -e .[dev] - - name: ๐Ÿชฎ Check source code formatting - id: format - run: | - if ruff format --diff $PKG_DIR; then - echo passed=yes >>"$GITHUB_OUTPUT" - else - echo passed=no >>"$GITHUB_OUTPUT" - echo "::error::source code not formatted" - fi - env: - PKG_DIR: xshaper + run: uv sync --dev - name: ๐Ÿœ Check source code lint rules + uses: astral-sh/ruff-action@v1 id: lint - run: | - if ruff check --output-format=github $PKG_DIR; then - echo passed=yes >>"$GITHUB_OUTPUT" - else - echo passed=no >>"$GITHUB_OUTPUT" - echo "::error::source code lint check failed" - fi - env: - PKG_DIR: xshaper - - name: ๐Ÿงพ Checking lint and format results - run: | - if [ "$FMT_PASSED" = no ]; then - echo "::error::format failed, failing build" - exit 1 - fi - if [ "$LINT_PASSED" = no ]; then - if [ "$LINT_REQUIRED" = true ]; then - echo "::error::lint failed, failing build" - exit 2 - else - echo "::error::lint failed but non-mandatory" - fi - fi - env: - FMT_PASSED: ${{ steps.format.outputs.passed }} - LINT_PASSED: ${{ steps.lint.outputs.passed }} - LINT_REQUIRED: True + with: + args: check --output-format=github xshaper - name: ๐Ÿ“ Check types id: typecheck uses: jakebailey/pyright-action@v1