diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f118a5b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [ main, development ] + pull_request: + branches: [ main, development ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install dependencies + run: | + poetry config virtualenvs.create false + poetry install --with dev + - name: Install pytest + run: poetry add --group dev pytest + - name: Run tests + run: poetry run pytest + - name: Run linting + run: | + poetry run black --check . + poetry run isort --check-only . + poetry run detect-secrets scan \ No newline at end of file diff --git a/.github/workflows/delete-branch.yml b/.github/workflows/delete-branch.yml new file mode 100644 index 0000000..56d5a61 --- /dev/null +++ b/.github/workflows/delete-branch.yml @@ -0,0 +1,19 @@ +name: Delete merged branch + +on: + pull_request: + types: [closed] + +permissions: + contents: write + +jobs: + delete-branch: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: Delete merged branch + run: gh branch delete ${{ github.head_ref }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file