From 2ffc7f30af67091f98cb45b7dbc6acd5412af4ab Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 12:20:28 +0100 Subject: [PATCH 01/14] Added renaming script test cases for invalid names --- .github/workflows/python-app.yml | 53 +++++++++++++++++++------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 29fbd06..3d6993c 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,24 +13,35 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint pytest-cov requests_mock pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Pylint - run: | - pylint $(git ls-files '*.py') - - name: Pytest - run: | - python3 -m pytest --cov=eric-oss-hello-world-python-app --cov-fail-under=90 - - name: markdownlint-cli - uses: nosborn/github-action-markdown-cli@v3.3.0 - with: - files: . - config_file: .markdownlint.yaml + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint pytest-cov requests_mock pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test renaming script + run: | + echo "Setting permissions for script" + chmod +x set_app_name.sh + echo "Testing renaming script with invalid name (unsupported characters)" + export APP_NAME="#INVALID" + ! ./set_app_name.sh + echo "Testing renaming script with invalid name (exceeding length)" + export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" + ! ./set_app_name.sh + + - name: Pylint + run: | + pylint $(git ls-files '*.py') + - name: Pytest + run: | + python3 -m pytest --cov=eric-oss-hello-world-python-app --cov-fail-under=90 + - name: markdownlint-cli + uses: nosborn/github-action-markdown-cli@v3.3.0 + with: + files: . + config_file: .markdownlint.yaml From c96c6a87380100e752753cb181e8a03ccca0001c Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 12:44:34 +0100 Subject: [PATCH 02/14] Added renaming script test case for valid name --- .github/workflows/python-app.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3d6993c..5cad1e6 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,6 +33,9 @@ jobs: echo "Testing renaming script with invalid name (exceeding length)" export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" ! ./set_app_name.sh + echo "Testing renaming script with valid name" + export APP_NAME="valid-app-name" + ./set_app_name.sh - name: Pylint run: | @@ -45,3 +48,4 @@ jobs: with: files: . config_file: .markdownlint.yaml + From 73c4c2ef74f6ff3d14e5bf8ce005d956e144256d Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 12:50:50 +0100 Subject: [PATCH 03/14] Moved renaming script tests into separate runs --- .github/workflows/python-app.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5cad1e6..730a930 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -24,18 +24,21 @@ jobs: pip install pylint pytest-cov requests_mock pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test renaming script - run: | - echo "Setting permissions for script" - chmod +x set_app_name.sh - echo "Testing renaming script with invalid name (unsupported characters)" - export APP_NAME="#INVALID" - ! ./set_app_name.sh - echo "Testing renaming script with invalid name (exceeding length)" - export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" - ! ./set_app_name.sh - echo "Testing renaming script with valid name" - export APP_NAME="valid-app-name" - ./set_app_name.sh + run: + - name: "Setting permissions for script" + run: chmod +x set_app_name.sh + - name: "Testing renaming script with invalid name (unsupported characters)" + run: | + export APP_NAME="#INVALID" + ! ./set_app_name.sh + - name: "Testing renaming script with invalid name (exceeding length)" + run: | + export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" + ! ./set_app_name.sh + - name: "Testing renaming script with valid name" + run: | + export APP_NAME="valid-app-name" + ./set_app_name.sh - name: Pylint run: | From 5bcb77cacf48bb4a4423d5d5b126e49113e89032 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 12:56:29 +0100 Subject: [PATCH 04/14] Moved renaming script tests into separate job --- .github/workflows/python-app.yml | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 730a930..23f4445 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,7 +10,25 @@ permissions: contents: read jobs: + test-renaming-script: + runs-on: ubuntu-latest + steps: + - name: "Setting permissions for script" + run: chmod +x set_app_name.sh + - name: "Testing renaming script with invalid name (unsupported characters)" + run: | + export APP_NAME="#INVALID" + ! ./set_app_name.sh + - name: "Testing renaming script with invalid name (exceeding length)" + run: | + export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" + ! ./set_app_name.sh + - name: "Testing renaming script with valid name" + run: | + export APP_NAME="valid-app-name" + ./set_app_name.sh build: + needs: test-renaming-script runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -23,22 +41,7 @@ jobs: python -m pip install --upgrade pip pip install pylint pytest-cov requests_mock pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Test renaming script - run: - - name: "Setting permissions for script" - run: chmod +x set_app_name.sh - - name: "Testing renaming script with invalid name (unsupported characters)" - run: | - export APP_NAME="#INVALID" - ! ./set_app_name.sh - - name: "Testing renaming script with invalid name (exceeding length)" - run: | - export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" - ! ./set_app_name.sh - - name: "Testing renaming script with valid name" - run: | - export APP_NAME="valid-app-name" - ./set_app_name.sh + - name: Pylint run: | From 687b78c3c14679ee2f6cb2055f95ace45acc50d3 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:30:06 +0100 Subject: [PATCH 05/14] Moved renaming script tests into composite action --- .../action.yml | 18 +++++++++++++++++ .github/workflows/python-app.yml | 20 ++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 .github/actions/renaming-script-composite-action/action.yml diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml new file mode 100644 index 0000000..3522989 --- /dev/null +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -0,0 +1,18 @@ +name: "Test renaming script" +runs: + using: "composite" + steps: + - name: "Setting permissions for script" + run: chmod +x set_app_name.sh + - name: "Testing renaming script with invalid name (unsupported characters)" + run: | + export APP_NAME="#INVALID" + ! ./set_app_name.sh + - name: "Testing renaming script with invalid name (exceeding length)" + run: | + export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" + ! ./set_app_name.sh + - name: "Testing renaming script with valid name" + run: | + export APP_NAME="valid-app-name" + ./set_app_name.sh \ No newline at end of file diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 23f4445..65cfefc 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -10,23 +10,6 @@ permissions: contents: read jobs: - test-renaming-script: - runs-on: ubuntu-latest - steps: - - name: "Setting permissions for script" - run: chmod +x set_app_name.sh - - name: "Testing renaming script with invalid name (unsupported characters)" - run: | - export APP_NAME="#INVALID" - ! ./set_app_name.sh - - name: "Testing renaming script with invalid name (exceeding length)" - run: | - export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" - ! ./set_app_name.sh - - name: "Testing renaming script with valid name" - run: | - export APP_NAME="valid-app-name" - ./set_app_name.sh build: needs: test-renaming-script runs-on: ubuntu-latest @@ -41,7 +24,8 @@ jobs: python -m pip install --upgrade pip pip install pylint pytest-cov requests_mock pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - + - name: Test renaming script + uses: ./.github/actions/renaming-script-composite-action/action.yml - name: Pylint run: | From 986f03b4391fa74e283f8f7fd0a235bab427bf91 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:31:06 +0100 Subject: [PATCH 06/14] Removed job dependency --- .github/workflows/python-app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 65cfefc..5957a62 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -11,7 +11,6 @@ permissions: jobs: build: - needs: test-renaming-script runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From ff97e884b7ae18eb96c28b237bbdc4f520e8164d Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:32:50 +0100 Subject: [PATCH 07/14] Updated composite action path --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5957a62..4b7b9ea 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -13,7 +13,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: @@ -24,7 +24,7 @@ jobs: pip install pylint pytest-cov requests_mock pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test renaming script - uses: ./.github/actions/renaming-script-composite-action/action.yml + uses: ./.github/actions/renaming-script-composite-action - name: Pylint run: | From 33f0c28424eb96364744ad05910d904cda45de79 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:34:35 +0100 Subject: [PATCH 08/14] Added shell to renaming script action --- .github/actions/renaming-script-composite-action/action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index 3522989..6d683aa 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -4,15 +4,19 @@ runs: steps: - name: "Setting permissions for script" run: chmod +x set_app_name.sh + shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" run: | export APP_NAME="#INVALID" ! ./set_app_name.sh + shell: bash - name: "Testing renaming script with invalid name (exceeding length)" run: | export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" ! ./set_app_name.sh + shell: bash - name: "Testing renaming script with valid name" run: | export APP_NAME="valid-app-name" - ./set_app_name.sh \ No newline at end of file + ./set_app_name.sh + shell: bash \ No newline at end of file From c0c16a26999a9be527328b7e5e8a208e1640b8c7 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:39:34 +0100 Subject: [PATCH 09/14] Added name to a single run for testing --- .github/actions/renaming-script-composite-action/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index 6d683aa..e96eea5 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -4,6 +4,7 @@ runs: steps: - name: "Setting permissions for script" run: chmod +x set_app_name.sh + name: "Setting permissions for script" shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" run: | From 961aa45ec6c3111f16593bedf7ba5c6c8761e4bd Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:42:44 +0100 Subject: [PATCH 10/14] Reformatted renaming script action --- .../renaming-script-composite-action/action.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index e96eea5..36771c2 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -4,20 +4,13 @@ runs: steps: - name: "Setting permissions for script" run: chmod +x set_app_name.sh - name: "Setting permissions for script" shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" - run: | - export APP_NAME="#INVALID" - ! ./set_app_name.sh + run: export APP_NAME="#INVALID" && ! ./set_app_name.sh shell: bash - name: "Testing renaming script with invalid name (exceeding length)" - run: | - export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" - ! ./set_app_name.sh + run: export APP_NAME="this-app-has-a-name-that-exceeds-fifty-three-characters" && ! ./set_app_name.sh shell: bash - name: "Testing renaming script with valid name" - run: | - export APP_NAME="valid-app-name" - ./set_app_name.sh + run: export APP_NAME="valid-app-name" && ./set_app_name.sh shell: bash \ No newline at end of file From 62665658194e6dc8497753ebf2cee75a46ebd7e4 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:50:22 +0100 Subject: [PATCH 11/14] Added step to reset app name --- .github/workflows/python-app.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 4b7b9ea..3e8af34 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -37,4 +37,6 @@ jobs: with: files: . config_file: .markdownlint.yaml + - name: Reset app name + run: export TARGET_DIR="../python-sample-app" && export APP_NAME="eric-oss-hello-world-python-app" && ./set_app_name.sh From 085f330df3391d2916d774006de5261c3a981a72 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:54:22 +0100 Subject: [PATCH 12/14] Added test case for missing APP_NAME --- .github/actions/renaming-script-composite-action/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index 36771c2..79b933a 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -5,6 +5,9 @@ runs: - name: "Setting permissions for script" run: chmod +x set_app_name.sh shell: bash + - name: "Testing renaming script with missing APP_NAME" + run: ! ./set_app_name.sh + shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" run: export APP_NAME="#INVALID" && ! ./set_app_name.sh shell: bash From fd1306cfc9d7dfd95ce1a2540ea6afc9e88205f1 Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:55:56 +0100 Subject: [PATCH 13/14] Fixed unescaped symbol --- .github/actions/renaming-script-composite-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index 79b933a..896614b 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -6,7 +6,7 @@ runs: run: chmod +x set_app_name.sh shell: bash - name: "Testing renaming script with missing APP_NAME" - run: ! ./set_app_name.sh + run: \! ./set_app_name.sh shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" run: export APP_NAME="#INVALID" && ! ./set_app_name.sh From dc2b92c4437cff8cfcafdc8a4fe703dc0e80c25d Mon Sep 17 00:00:00 2001 From: Kara Date: Tue, 16 Sep 2025 13:58:30 +0100 Subject: [PATCH 14/14] Fixed unescaped symbol (again) --- .github/actions/renaming-script-composite-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/renaming-script-composite-action/action.yml b/.github/actions/renaming-script-composite-action/action.yml index 896614b..f3c6bbc 100644 --- a/.github/actions/renaming-script-composite-action/action.yml +++ b/.github/actions/renaming-script-composite-action/action.yml @@ -6,7 +6,7 @@ runs: run: chmod +x set_app_name.sh shell: bash - name: "Testing renaming script with missing APP_NAME" - run: \! ./set_app_name.sh + run: "! ./set_app_name.sh" shell: bash - name: "Testing renaming script with invalid name (unsupported characters)" run: export APP_NAME="#INVALID" && ! ./set_app_name.sh