From 1e97c25b1610ed3ba988a28dccf0965bccee6fd0 Mon Sep 17 00:00:00 2001 From: WhatCouldIDoWithThisKnowledge Date: Tue, 9 Dec 2025 12:48:28 +0100 Subject: [PATCH 1/2] como este sea otra vez el repo original me suicido --- .github/{ => workflows}/git-test.yaml | 0 .github/{ => workflows}/github-actions-demo.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/git-test.yaml (100%) rename .github/{ => workflows}/github-actions-demo.yaml (100%) diff --git a/.github/git-test.yaml b/.github/workflows/git-test.yaml similarity index 100% rename from .github/git-test.yaml rename to .github/workflows/git-test.yaml diff --git a/.github/github-actions-demo.yaml b/.github/workflows/github-actions-demo.yaml similarity index 100% rename from .github/github-actions-demo.yaml rename to .github/workflows/github-actions-demo.yaml From 7ab3e01fade7a60c9f4f597371bdba0d8ba72440 Mon Sep 17 00:00:00 2001 From: WhatCouldIDoWithThisKnowledge Date: Tue, 9 Dec 2025 13:48:48 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Creo=20que=20ya=20est=C3=A1=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/code-safety/build_image.yml | 16 +++++++ .../workflows/code-safety/check-formatter.yml | 23 ++++++++++ .../workflows/code-safety/check-linter.yml | 22 ++++++++++ .../code-safety/check-type-safety.yml | 23 ++++++++++ .github/workflows/code-safety/deploy.yml | 34 +++++++++++++++ .../workflows/code-safety/run-unit-tests.yml | 25 +++++++++++ .github/workflows/git-test.yaml | 43 ++++++++++++------- .github/workflows/github-actions-demo.yaml | 43 +++++++------------ 8 files changed, 186 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/code-safety/build_image.yml create mode 100644 .github/workflows/code-safety/check-formatter.yml create mode 100644 .github/workflows/code-safety/check-linter.yml create mode 100644 .github/workflows/code-safety/check-type-safety.yml create mode 100644 .github/workflows/code-safety/deploy.yml create mode 100644 .github/workflows/code-safety/run-unit-tests.yml diff --git a/.github/workflows/code-safety/build_image.yml b/.github/workflows/code-safety/build_image.yml new file mode 100644 index 0000000..ce52763 --- /dev/null +++ b/.github/workflows/code-safety/build_image.yml @@ -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 . + diff --git a/.github/workflows/code-safety/check-formatter.yml b/.github/workflows/code-safety/check-formatter.yml new file mode 100644 index 0000000..8decd2b --- /dev/null +++ b/.github/workflows/code-safety/check-formatter.yml @@ -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 . + diff --git a/.github/workflows/code-safety/check-linter.yml b/.github/workflows/code-safety/check-linter.yml new file mode 100644 index 0000000..9b4267f --- /dev/null +++ b/.github/workflows/code-safety/check-linter.yml @@ -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 . diff --git a/.github/workflows/code-safety/check-type-safety.yml b/.github/workflows/code-safety/check-type-safety.yml new file mode 100644 index 0000000..a886cc9 --- /dev/null +++ b/.github/workflows/code-safety/check-type-safety.yml @@ -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 + diff --git a/.github/workflows/code-safety/deploy.yml b/.github/workflows/code-safety/deploy.yml new file mode 100644 index 0000000..2c9e480 --- /dev/null +++ b/.github/workflows/code-safety/deploy.yml @@ -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}" \ No newline at end of file diff --git a/.github/workflows/code-safety/run-unit-tests.yml b/.github/workflows/code-safety/run-unit-tests.yml new file mode 100644 index 0000000..bb2e436 --- /dev/null +++ b/.github/workflows/code-safety/run-unit-tests.yml @@ -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 + diff --git a/.github/workflows/git-test.yaml b/.github/workflows/git-test.yaml index dbc491d..f3dfcf1 100644 --- a/.github/workflows/git-test.yaml +++ b/.github/workflows/git-test.yaml @@ -1,18 +1,31 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] +name: Code Quality +run-name: ${{ github.actor }} is checking code quality + +on: + pull_request: + branches: + - main + jobs: - Explore-GitHub-Actions: + unit-tests: + name: python runs-on: ubuntu-latest + steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v5 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file + - uses: actions/checkout@v5 + + - name: "Set up Python" + uses: actions/setup-python@v6 + with: + python-version-file: ".python-version" + + - name: Install uv + uses: astral-sh/setup-uv@v7 + + - name: Install the project + run: uv sync --all-extras --dev + shell: bash + + - name: Run unit tests + run: uv run pytest + shell: bash \ No newline at end of file diff --git a/.github/workflows/github-actions-demo.yaml b/.github/workflows/github-actions-demo.yaml index f3dfcf1..dbc491d 100644 --- a/.github/workflows/github-actions-demo.yaml +++ b/.github/workflows/github-actions-demo.yaml @@ -1,31 +1,18 @@ -name: Code Quality -run-name: ${{ github.actor }} is checking code quality - -on: - pull_request: - branches: - - main - +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +on: [push] jobs: - unit-tests: - name: python + Explore-GitHub-Actions: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - - name: "Set up Python" - uses: actions/setup-python@v6 - with: - python-version-file: ".python-version" - - - name: Install uv - uses: astral-sh/setup-uv@v7 - - - name: Install the project - run: uv sync --all-extras --dev - shell: bash - - - name: Run unit tests - run: uv run pytest - shell: bash \ No newline at end of file + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v5 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." \ No newline at end of file