From b02a4ced8bee6fb277dfcbea9a079d97e2aeb6ab Mon Sep 17 00:00:00 2001 From: Sangjun Park Date: Mon, 8 Jun 2026 21:26:53 +0000 Subject: [PATCH 1/3] ci: add github action config --- .github/workflows/validate.yml | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..fbb5944 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,57 @@ +name: CI + +on: + push: + pull_request: + +jobs: + run-test: + name: Run Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + uses: astral-sh/setup-uv@v5 + with: + python-version: "3.12.12" + enable-cache: true + + - name: Install Dependencies + run: | + uv venv --allow-existing + uv pip install -r requirements.txt -r requirements-dev.txt + + - name: Run Tests + run: | + source .venv/bin/activate + pytest --cov-branch --cov --cov-report=xml + + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: coverage.xml + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + check-linting: + name: Check Linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + uses: astral-sh/setup-uv@v5 + with: + python-version: "3.12.12" + enable-cache: true + + - name: Install Dependencies + run: | + uv venv --allow-existing + uv pip install -r requirements.txt -r requirements-dev.txt + + - name: Run Ruff + run: | + source .venv/bin/activate + ruff check sample_package tests From 7525b5a8c10e26a6cd3f763102c25159013b7d88 Mon Sep 17 00:00:00 2001 From: Sangjun Park Date: Mon, 8 Jun 2026 21:30:25 +0000 Subject: [PATCH 2/3] ci: fail ci if codecov error --- .github/workflows/validate.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fbb5944..a769b67 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -31,6 +31,7 @@ jobs: uses: codecov/codecov-action@v5 with: files: coverage.xml + fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From c20e3a284430824cc273503c193d0fd92402f75c Mon Sep 17 00:00:00 2001 From: Sangjun Park Date: Mon, 8 Jun 2026 21:33:39 +0000 Subject: [PATCH 3/3] fix: github codecov error --- .github/workflows/validate.yml | 1 + README.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a769b67..62d0fe8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,6 +32,7 @@ jobs: with: files: coverage.xml fail_ci_if_error: true + use_pypi: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 950140f..3e35c58 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Python Project Setup [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) -[![cosmoquester](https://circleci.com/gh/cosmoquester/python3-template.svg?style=svg)](https://app.circleci.com/pipelines/github/cosmoquester/python3-template) +[![CircleCI](https://circleci.com/gh/cosmoquester/python3-template.svg?style=svg)](https://app.circleci.com/pipelines/github/cosmoquester/python3-template) +[![GithubAction](https://github.com/cosmoquester/python3-template/actions/workflows/validate.yml/badge.svg)](https://github.com/cosmoquester/python3-template/actions/workflows/validate.yml) - This repository is template for my python project