diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7f9f09d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,20 @@ +name: Publish +on: + push: + branches: [master] +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v7 + - name: Setup UV + uses: astral-sh/setup-uv@v8.2.0 + with: + python-version: "3.13" + - name: Run uv build + run: uv build + - name: Publish to PYPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..092852d --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,40 @@ +name: Pull Request +on: + pull_request: + branches: [master] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + - name: Setup UV + uses: astral-sh/setup-uv@v8.2.0 + with: + python-version: "3.13" + - name: Run uv sync + run: uv sync + - name: Run linter + run: uv run ruff check src/ tests/ + - name: Run formatter + run: uv run ruff format --check src/ tests/ + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup UV + uses: astral-sh/setup-uv@v8.2.0 + with: + python-version: ${{ matrix.python-version }} + - name: Run uv sync + run: uv sync + - name: Load sandbox credentials + env: + SANDBOX_ENV: ${{ secrets.SANDBOX_ENV }} + run: printf '%s\n' "$SANDBOX_ENV" > .env + - name: Run tests + run: uv run pytest tests/ -q