Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/code-safety/build_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: build_image.yml

on:
push:
branches:
- main

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Build Docker image
run: docker build -t python-kata-wompwomp:latest .

23 changes: 23 additions & 0 deletions .github/workflows/code-safety/check-formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: check-formatter.yml

on:
pull_request:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install project
run: uv sync --group dev

- name: Check formatting
run: uv run ruff format --check .

22 changes: 22 additions & 0 deletions .github/workflows/code-safety/check-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: check-linter.yml
run-name: ${{ github.actor }} is making linter checks

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install project
run: uv sync --group dev

- name: Run ruff (lint)
run: uv run ruff check .
23 changes: 23 additions & 0 deletions .github/workflows/code-safety/check-type-safety.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: check-type-safety.yml

on:
pull_request:
branches:
- main

jobs:
typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install project
run: uv sync --group dev

- name: Run Pyright
run: uv run pyright

34 changes: 34 additions & 0 deletions .github/workflows/code-safety/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: deploy.yml

on:
push:
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and tag image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/python-kata-wompwomp:latest .

- name: Push image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/python-kata-wompwomp:latest

- name: Deploy to Render
env:
RENDER_WEBHOOK: ${{ secrets.RENDER_DEPLOY_WEBHOOK }}
IMAGE_URL: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/python-kata-wompwomp:latest
run: |
ENCODED_IMAGE_URL=$(echo -n "$IMAGE_URL" | jq -s -R -r @uri)
curl "${RENDER_WEBHOOK}&imgURL=${ENCODED_IMAGE_URL}"
25 changes: 25 additions & 0 deletions .github/workflows/code-safety/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: run-unit-tests.yml

on:
pull_request:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.x"

- name: Sync dependencies
run: uv sync --group dev

- name: Run tests
run: uv run pytest

File renamed without changes.
File renamed without changes.