From 7870644af3a3d657e36cc491fb3abb286977b215 Mon Sep 17 00:00:00 2001 From: OseSem <91069296+OseSem@users.noreply.github.com> Date: Fri, 10 May 2024 22:34:39 +0200 Subject: [PATCH 1/6] Change CI --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 30 ----------------------- 2 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6caefc8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI +on: + push: + +jobs: + pre-commit: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ "3.10", "3.11", "3.12" ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.1 + with: + extra_args: --all-files + + pyright: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ "3.11" ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + cache: 'pip' + python-version: "3.11" + - run: poetry install + - run: pip install -r requirements.txt + + - uses: jakebailey/pyright-action@v2 + with: + pylance-version: latest-release + + check: # This job does nothing and is only used for the branch protection + if: always() + needs: + - pre-commit + - pyright + + runs-on: ubuntu-latest + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 17a33c1..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Lint - -on: - push: - branches: - - 'master' - pull_request: - merge_group: - -permissions: - read-all - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Run pre-commit - id: pre-commit - uses: pre-commit/action@v3.0.0 From d6ec49d1e9d875822dc8bd661e4f073c7870c2a2 Mon Sep 17 00:00:00 2001 From: OseSem <91069296+OseSem@users.noreply.github.com> Date: Fri, 10 May 2024 22:39:48 +0200 Subject: [PATCH 2/6] Small changes --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6caefc8..db7bdab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI on: push: + branches: + - 'master' + pull_request: + merge_group: jobs: pre-commit: From 95ffec7e4d3aa9880ee3016a84a7ce875ced8fa1 Mon Sep 17 00:00:00 2001 From: OseSem <91069296+OseSem@users.noreply.github.com> Date: Fri, 10 May 2024 22:43:34 +0200 Subject: [PATCH 3/6] Some more fixes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db7bdab..440d552 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.10", "3.11", "3.12" ] + python-version: [ "3.11" ] fail-fast: false steps: - uses: actions/checkout@v3 @@ -51,4 +51,4 @@ jobs: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@v1.2.2 with: - jobs: ${{ toJSON(needs) }} \ No newline at end of file + jobs: ${{ toJSON(needs) }} From e2c63a03d620964d9c0117d3c6e37bb7665c357b Mon Sep 17 00:00:00 2001 From: OseSem <91069296+OseSem@users.noreply.github.com> Date: Fri, 10 May 2024 22:44:14 +0200 Subject: [PATCH 4/6] Remove poetry from pyright workflow --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 440d552..c3a7235 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: with: cache: 'pip' python-version: "3.11" - - run: poetry install - run: pip install -r requirements.txt - uses: jakebailey/pyright-action@v2 From e39f9f9976b5875c11cffdf5bd3028d64de2a4c2 Mon Sep 17 00:00:00 2001 From: OseSem <91069296+OseSem@users.noreply.github.com> Date: Fri, 10 May 2024 22:57:27 +0200 Subject: [PATCH 5/6] Add myself to workflows codeowner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..c0598cc --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +.github/**/* @OseSem \ No newline at end of file From 1c830d3d120bfbd0810282dd919345668e8006be Mon Sep 17 00:00:00 2001 From: Known Black Hat <65008967+KnownBlackHat@users.noreply.github.com> Date: Fri, 10 May 2024 22:24:54 -0400 Subject: [PATCH 6/6] ci: use github vars for python version specifications --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3a7235..f7d210f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,39 +4,64 @@ on: branches: - 'master' pull_request: - merge_group: + +permissions: + read-all + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +defaults: + run: + shell: bash jobs: pre-commit: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.11" ] + python-version: [ "3.11", "3.12" ] fail-fast: false steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.1 - with: - extra_args: --all-files + - uses: actions/checkout@v4 + - name: Run pre-commit + id: pre-commit + uses: pre-commit/action@v3.0.1 + pyright: runs-on: ubuntu-latest strategy: matrix: - python-version: [ "3.11" ] + python-version: [ "3.11", "3.12" ] fail-fast: false + continue-on-error: ${{ matrix.experimental }} + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: cache: 'pip' - python-version: "3.11" + python-version: ${{ matrix.python-version }} - run: pip install -r requirements.txt - - uses: jakebailey/pyright-action@v2 + + - name: Run Pyright (Linux) + uses: jakebailey/pyright-action@v2.2.1 + with: + pylance-version: latest-release + python-platform: "Linux" + python-version: ${{ matrix.python-version }} + warnings: true + + - name: Run Pyright (Windows) + uses: jakebailey/pyright-action@v2.2.1 with: pylance-version: latest-release + python-platform: "Windows" + python-version: ${{ matrix.python-version }} + warnings: true check: # This job does nothing and is only used for the branch protection if: always()