From 4605909c89a014ccbee5b59aaa4e67dae3144624 Mon Sep 17 00:00:00 2001 From: Aliaksei Urbanski Date: Sat, 11 May 2024 23:49:52 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BC=20Add=20a=20basic=20CI?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ README.md | 4 ++++ tox.ini | 2 +- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e984fc5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + - push + - pull_request + +env: + FORCE_COLOR: 1 + +jobs: + test: + name: ๐Ÿงช Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: + - '3.12' + - '3.11' + - '3.10' + steps: + - uses: actions/checkout@v4 + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: pdm install -G test --frozen-lockfile + - name: Run pytest + run: pdm run pytest -v + + lint: + name: ๐Ÿง Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: '3.12' + - name: Install dependencies + run: pdm install -G lint --frozen-lockfile + - name: Lint with ruff + run: | + pdm run ruff check . + pdm run ruff format --check . + - name: Type check with mypy + run: pdm run mypy diff --git a/README.md b/README.md index c5d3940..8fa74ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ๐Ÿ—ƒ๏ธ Gentoo Cache Manager +[![CI][ci-badge]][ci] + **Gentoo Cache Manager** aims to help you tweaking build cache settings for individual packages in [Gentoo Linux][gentoo] and some [Gentoo-based][gentoo-based] operating systems. ## ๐Ÿง‘๐Ÿฝโ€๐Ÿ”ฌ Usage @@ -14,6 +16,8 @@ To disable it, run: gcm disable glibc ``` +[ci-badge]: https://img.shields.io/github/actions/workflow/status/Jamim/gentoo-cache-manager/ci.yml.svg +[ci]: https://github.com/Jamim/gentoo-cache-manager/actions/workflows/ci.yml [gentoo]: https://www.gentoo.org [gentoo-based]: https://wiki.gentoo.org/wiki/Distributions_based_on_Gentoo [ccache]: https://wiki.gentoo.org/wiki/Ccache diff --git a/tox.ini b/tox.ini index 76ed9c6..ce5c2fb 100644 --- a/tox.ini +++ b/tox.ini @@ -20,6 +20,6 @@ commands = ruff format --check . [testenv:lint-mypy] -skip_install = true +package = editable deps = mypy commands = mypy