From 7a603a22a352b263dbab360bdcb20bcf49e6857a Mon Sep 17 00:00:00 2001 From: daawaan4U Date: Sun, 15 Sep 2024 16:56:42 +0800 Subject: [PATCH] ci: setup github actions and ruff --- .github/actions/setup.yaml | 10 ++++++++++ .github/workflows/checks.yaml | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 .github/actions/setup.yaml create mode 100644 .github/workflows/checks.yaml diff --git a/.github/actions/setup.yaml b/.github/actions/setup.yaml new file mode 100644 index 0000000..19c399d --- /dev/null +++ b/.github/actions/setup.yaml @@ -0,0 +1,10 @@ +name: Setup +description: Setup repository +runs: + using: composite + steps: + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + cache: pip + - run: pip install -r requirements.txt diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml new file mode 100644 index 0000000..3528469 --- /dev/null +++ b/.github/workflows/checks.yaml @@ -0,0 +1,19 @@ +name: Check +on: [push, pull_request] + +jobs: + ruff-check: + name: Ruff Checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/setup + - run: ruff check + + ruff-format: + name: Ruff Formatter + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/setup + - run: ruff format