From 751b83aeba7539dbacc705594e374744e167b956 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 12:56:44 +0100 Subject: [PATCH 01/11] Move linting to github actions --- .github/workflows/lint.yml | 13 +++++++++++++ .gitlab-ci.yml | 22 ---------------------- 2 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1baafa1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,13 @@ +name: Test Neureka +on: push +jobs: + python-lint: + runs-on: ubuntu-latest + working-directory: test + steps: + - uses: actions/checkout@v4 + - uses: psf/black@stable + - uses: jakebailey/pyright-action@v2 + - uses: isort/isort-action@v1 + with: + requirements-files: "requirements-pip.txt" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e0e3ce0..38d3372 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,30 +17,8 @@ # SPDX-License-Identifier: Apache-2.0 stages: - - lint - test -python_format: - stage: lint - tags: - - python-lint - script: - - black --check . - -python_sort_imports: - stage: lint - tags: - - python-lint - script: - - isort --check test - -python_static_check: - stage: lint - tags: - - python-lint - script: - - pyright . - run_ne16_test: stage: test tags: From 03b5f8e5b76477e67fded6a497646f9f132612f6 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:00:03 +0100 Subject: [PATCH 02/11] Move working-directory into steps --- .github/workflows/lint.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1baafa1..22d6b20 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,11 +3,13 @@ on: push jobs: python-lint: runs-on: ubuntu-latest - working-directory: test steps: - uses: actions/checkout@v4 - uses: psf/black@stable + working-directory: test - uses: jakebailey/pyright-action@v2 + working-directory: test - uses: isort/isort-action@v1 + working-directory: test with: requirements-files: "requirements-pip.txt" From b7b6729ff3cf52700786e7f50eee4aaccda82e45 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:04:59 +0100 Subject: [PATCH 03/11] Fix working-directory to what each action wants --- .github/workflows/lint.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 22d6b20..f4d8d24 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Test Neureka +name: Linting on: push jobs: python-lint: @@ -6,10 +6,12 @@ jobs: steps: - uses: actions/checkout@v4 - uses: psf/black@stable - working-directory: test + with: + src: "test" - uses: jakebailey/pyright-action@v2 - working-directory: test + with: + working-directory: test - uses: isort/isort-action@v1 - working-directory: test with: - requirements-files: "requirements-pip.txt" + sort-paths: "test" + requirements-files: "requirements-pip.txt" From c199e0d45dcbe15b862ecac39e35bac7ef71e944 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:06:43 +0100 Subject: [PATCH 04/11] Do isort before pyright to install required packages --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f4d8d24..c48cafa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,10 +8,10 @@ jobs: - uses: psf/black@stable with: src: "test" - - uses: jakebailey/pyright-action@v2 - with: - working-directory: test - uses: isort/isort-action@v1 with: sort-paths: "test" requirements-files: "requirements-pip.txt" + - uses: jakebailey/pyright-action@v2 + with: + working-directory: test From 9c4d7271149445e10f258484ad2eef0eb437caa3 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:07:41 +0100 Subject: [PATCH 05/11] Revert "Do isort before pyright to install required packages" This reverts commit c199e0d45dcbe15b862ecac39e35bac7ef71e944. --- .github/workflows/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c48cafa..f4d8d24 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,10 +8,10 @@ jobs: - uses: psf/black@stable with: src: "test" + - uses: jakebailey/pyright-action@v2 + with: + working-directory: test - uses: isort/isort-action@v1 with: sort-paths: "test" requirements-files: "requirements-pip.txt" - - uses: jakebailey/pyright-action@v2 - with: - working-directory: test From 7f92603a21219646ea6840b9ed968afad1f8d33e Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:08:32 +0100 Subject: [PATCH 06/11] Use the container I built --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f4d8d24..6d3e1e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,6 +3,7 @@ on: push jobs: python-lint: runs-on: ubuntu-latest + container: ghcr.io/pulp-platform/pulp-nnx:main-test steps: - uses: actions/checkout@v4 - uses: psf/black@stable From da0f95598e7985b25e487756587ced27d6460678 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:14:13 +0100 Subject: [PATCH 07/11] Install requirements in the github machine for pyright to work --- .github/workflows/lint.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6d3e1e9..2c17902 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,10 +9,16 @@ jobs: - uses: psf/black@stable with: src: "test" + # Needed by pyright + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - run: | + pip install -r test/requirements-pip.txt - uses: jakebailey/pyright-action@v2 with: working-directory: test - uses: isort/isort-action@v1 with: sort-paths: "test" - requirements-files: "requirements-pip.txt" From 42af9b82c033a31b2f1f455d57f1689d1adc7a25 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:15:02 +0100 Subject: [PATCH 08/11] Revert "Use the container I built" This reverts commit 7f92603a21219646ea6840b9ed968afad1f8d33e. --- .github/workflows/lint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2c17902..b9c8dbe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,6 @@ on: push jobs: python-lint: runs-on: ubuntu-latest - container: ghcr.io/pulp-platform/pulp-nnx:main-test steps: - uses: actions/checkout@v4 - uses: psf/black@stable From 31a718f8b1d6ca9f690af4a98095549cee924270 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:22:21 +0100 Subject: [PATCH 09/11] Rename requirements-pip.txt to requirements.txt so that setup-python github action is happy --- .github/workflows/lint.yml | 2 +- test/{requirements-pip.txt => requirements.txt} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename test/{requirements-pip.txt => requirements.txt} (100%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b9c8dbe..f64ae74 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: python-version: '3.10' cache: 'pip' - run: | - pip install -r test/requirements-pip.txt + pip install -r test/requirements.txt - uses: jakebailey/pyright-action@v2 with: working-directory: test diff --git a/test/requirements-pip.txt b/test/requirements.txt similarity index 100% rename from test/requirements-pip.txt rename to test/requirements.txt From 9173164d2a17ee0bd599a317595ea4920cc851bf Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:48:48 +0100 Subject: [PATCH 10/11] Change tests to trigger only on pull-requests --- .github/workflows/gitlab-ci-action.yml | 6 ++---- .github/workflows/test-neureka.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gitlab-ci-action.yml b/.github/workflows/gitlab-ci-action.yml index 218d00c..e794c56 100644 --- a/.github/workflows/gitlab-ci-action.yml +++ b/.github/workflows/gitlab-ci-action.yml @@ -1,7 +1,5 @@ -name: gitlab-ci - -on: [ push, pull_request, workflow_dispatch ] - +name: "[GitLab] Ne16 tests" +on: pull_request jobs: gitlab-ci: runs-on: ubuntu-latest diff --git a/.github/workflows/test-neureka.yml b/.github/workflows/test-neureka.yml index a65eade..d6878b0 100644 --- a/.github/workflows/test-neureka.yml +++ b/.github/workflows/test-neureka.yml @@ -1,5 +1,5 @@ name: Test Neureka -on: push +on: pull_request jobs: test: runs-on: ubuntu-latest From 2a474f18193a02be77d50840b0da8aa613fc7a76 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 26 Dec 2024 13:50:27 +0100 Subject: [PATCH 11/11] Rename gitlab-ci-action.yml to test-ne16 --- .github/workflows/{gitlab-ci-action.yml => test-ne16.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{gitlab-ci-action.yml => test-ne16.yml} (95%) diff --git a/.github/workflows/gitlab-ci-action.yml b/.github/workflows/test-ne16.yml similarity index 95% rename from .github/workflows/gitlab-ci-action.yml rename to .github/workflows/test-ne16.yml index e794c56..815d381 100644 --- a/.github/workflows/gitlab-ci-action.yml +++ b/.github/workflows/test-ne16.yml @@ -1,4 +1,4 @@ -name: "[GitLab] Ne16 tests" +name: "Test Ne16 (GitLab)" on: pull_request jobs: gitlab-ci: