From e1dfdad66697d850da7becafd06cfc54f1da6492 Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:21:33 +0800 Subject: [PATCH 1/6] ci: reuse lint --- .github/workflows/lint.yaml | 45 +------------------------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c408b97..003b174 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -11,47 +11,4 @@ on: jobs: lint: - name: Perform lint - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: ["3.11"] - - steps: - - name: Harden Runner - uses: step-security/harden-runner@80b2fcb96ae248b7b80d284855acf93c338a6a0a # v2.5.0 - with: - egress-policy: audit - - - name: Checkout repository - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3.5.3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.0 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install and upgrade PIP - run: python -m pip install --upgrade pip - - - name: Install Dependencies - run: > - pip install - ruff - black - mypy - - - name: Ruff Linter - run: ruff check . --diff - - - name: Black Formatter - run: black . --diff --check - - - name: Mypy Type Checker - run: > - mypy . - --install-types - --non-interactive - --ignore-missing-imports + uses: seyLu/reusable-workflows/.github/workflows/py-lint.yaml@d05d0ee217b79e6cc95d57291203e9c8765a7705 From f5c906295360b08675dc59eafca356a3ec1e0f23 Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:37:50 +0800 Subject: [PATCH 2/6] ci: trigger py-lint on python file change only --- .github/workflows/lint.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 003b174..01c5634 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -5,10 +5,14 @@ on: push: branches: - main + paths: + - '**.py' pull_request: branches: - main + paths: + - '**.py' jobs: - lint: - uses: seyLu/reusable-workflows/.github/workflows/py-lint.yaml@d05d0ee217b79e6cc95d57291203e9c8765a7705 + py-lint: + uses: seyLu/reusable-workflows/.github/workflows/py-lint.yaml@3021aa9fba55bdbdc207fd84cfc60e9a7b4a33eb # main From d6226262f9a041b5db251eb466937f4b3adca454 Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:40:44 +0800 Subject: [PATCH 3/6] test --- scripts/test.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 scripts/test.py diff --git a/scripts/test.py b/scripts/test.py new file mode 100644 index 0000000..244a421 --- /dev/null +++ b/scripts/test.py @@ -0,0 +1,2 @@ +if __name__ == "__main__": + pass From e48dadc323f623dc2564f877aaf63576e421d16b Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:42:54 +0800 Subject: [PATCH 4/6] test --- scripts/test.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 scripts/test.js diff --git a/scripts/test.js b/scripts/test.js new file mode 100644 index 0000000..6b2b3db --- /dev/null +++ b/scripts/test.js @@ -0,0 +1 @@ +console.log("hello world"); From 67d6a3c025c2ce4a8d912f5a1e8430d827135194 Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:49:06 +0800 Subject: [PATCH 5/6] chore: remove test.js --- scripts/test.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 scripts/test.js diff --git a/scripts/test.js b/scripts/test.js deleted file mode 100644 index 6b2b3db..0000000 --- a/scripts/test.js +++ /dev/null @@ -1 +0,0 @@ -console.log("hello world"); From 4be38a66e6b2d568c700681d11dc157da6e62a0e Mon Sep 17 00:00:00 2001 From: seylu <98249191+seyLu@users.noreply.github.com> Date: Sun, 17 Sep 2023 13:52:53 +0800 Subject: [PATCH 6/6] ci: test lint --- scripts/test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/test.py b/scripts/test.py index 244a421..198877f 100644 --- a/scripts/test.py +++ b/scripts/test.py @@ -1,2 +1,6 @@ +def main() -> str: + return None + + if __name__ == "__main__": - pass + main()