From fec298bec004016ec1236f82b88844ba7e45307d Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Wed, 11 Sep 2024 12:05:20 +0100 Subject: [PATCH 01/13] Add GitHub Action for applying Coding Standards configuration --- .../action.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/actions/apply-coding-standards-configuration/action.yml diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml new file mode 100644 index 0000000000..f901238061 --- /dev/null +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -0,0 +1,15 @@ +name: Applies Coding Standard configuration files in the repository +description: | + Installs Python and indexes the CodeQL Coding Standard configuration files in the repository + +runs: + using: composite + steps: + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 + - name: Install dependencies + run: python -m pip install -r ${{ github.action_path }}/scripts/configuration/requirements.txt + - name: Process files + run: python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py \ No newline at end of file From f6c05fe6cd0c276543106b86caf72771fff9b424 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:32:59 +0100 Subject: [PATCH 02/13] Update action.yml --- .../actions/apply-coding-standards-configuration/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index f901238061..a5b751793f 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -10,6 +10,8 @@ runs: with: python-version: 3.9 - name: Install dependencies + shell: bash run: python -m pip install -r ${{ github.action_path }}/scripts/configuration/requirements.txt - name: Process files - run: python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py \ No newline at end of file + shell: bash + run: python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py From 8c22681df43e205a66535b72daf54373c2df8614 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:37:35 +0100 Subject: [PATCH 03/13] Update action.yml --- .../actions/apply-coding-standards-configuration/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index a5b751793f..e1580e5f23 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: python -m pip install -r ${{ github.action_path }}/scripts/configuration/requirements.txt + run: cd ../../../; python -m pip install -r ${{ github.action_path }}/scripts/configuration/requirements.txt - name: Process files shell: bash - run: python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py + run: cd ../../../; python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py From 2dc4836be1bdc9ddde8a15e5f7a7af272bc93854 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:39:34 +0100 Subject: [PATCH 04/13] Update action.yml --- .../actions/apply-coding-standards-configuration/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index e1580e5f23..49ecc01176 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: cd ../../../; python -m pip install -r ${{ github.action_path }}/scripts/configuration/requirements.txt + run: cd ../../../; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt - name: Process files shell: bash - run: cd ../../../; python ${{ github.action_path }}/scripts/configuration/process_coding_standards_config.py + run: cd ../../../; python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py From 6d95d66a17cca4933cd8262d0d1f4cbe68270c67 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:53:58 +0100 Subject: [PATCH 05/13] Update action.yml --- .../actions/apply-coding-standards-configuration/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index 49ecc01176..ae107f80a2 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: cd ../../../; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt + run: ls ${{ github.action_path }}/../../..; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt - name: Process files shell: bash - run: cd ../../../; python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py + run: python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py From 7315e190f5035ddee3b23f03b7452a3f15aa173a Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:44:46 +0100 Subject: [PATCH 06/13] Update action.yml --- .github/actions/apply-coding-standards-configuration/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index ae107f80a2..8edc6e954c 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: ls ${{ github.action_path }}/../../..; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt + run: cd ../../../; ls; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt - name: Process files shell: bash run: python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py From 2d047cfdc826774039fc936c386c3604cd23e649 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:47:02 +0100 Subject: [PATCH 07/13] Update action.yml --- .github/actions/apply-coding-standards-configuration/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index 8edc6e954c..e0264a5cc8 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: cd ../../../; ls; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt + run: cd ${{ github.action_path }}; cd ../../../; ls; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt - name: Process files shell: bash run: python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py From bac877f5d1c703c36c8874664fef0ad2c94054e5 Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:53:02 +0100 Subject: [PATCH 08/13] Update action.yml --- .../actions/apply-coding-standards-configuration/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index e0264a5cc8..c5c58ebc3c 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -11,7 +11,7 @@ runs: python-version: 3.9 - name: Install dependencies shell: bash - run: cd ${{ github.action_path }}; cd ../../../; ls; python -m pip install -r ${{ github.action_path }}/../../../scripts/configuration/requirements.txt + run: python -m pip install -r ${GITHUB_ACTION_PATH}/../../../scripts/configuration/requirements.txt - name: Process files shell: bash - run: python ${{ github.action_path }}/../../../scripts/configuration/process_coding_standards_config.py + run: python ${GITHUB_ACTION_PATH}/../../../scripts/configuration/process_coding_standards_config.py From b78397ac4e8f9f780e7b0d2ceb98ab24be87ffad Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:35:41 +0100 Subject: [PATCH 09/13] Update action.yml --- .../apply-coding-standards-configuration/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index c5c58ebc3c..7a621bb45f 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -5,10 +5,10 @@ description: | runs: using: composite steps: - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: 3.9 + # - name: Install Python + # uses: actions/setup-python@v5 + # with: + # python-version: 3.9 - name: Install dependencies shell: bash run: python -m pip install -r ${GITHUB_ACTION_PATH}/../../../scripts/configuration/requirements.txt From 382d4f34c15170f029027f01e96ae10345f59e9f Mon Sep 17 00:00:00 2001 From: Luke Cartey <5377966+lcartey@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:47:10 +0100 Subject: [PATCH 10/13] Update action.yml --- .../apply-coding-standards-configuration/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/.github/actions/apply-coding-standards-configuration/action.yml index 7a621bb45f..c5c58ebc3c 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/.github/actions/apply-coding-standards-configuration/action.yml @@ -5,10 +5,10 @@ description: | runs: using: composite steps: - # - name: Install Python - # uses: actions/setup-python@v5 - # with: - # python-version: 3.9 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: 3.9 - name: Install dependencies shell: bash run: python -m pip install -r ${GITHUB_ACTION_PATH}/../../../scripts/configuration/requirements.txt From 0266e46e26a2a96bae92b2ae833c1e420be94106 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 22 Oct 2024 11:14:48 +0100 Subject: [PATCH 11/13] Move the action to a more discoverable location, improve isolation --- .../action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {.github/actions/apply-coding-standards-configuration => apply-configuration}/action.yml (54%) diff --git a/.github/actions/apply-coding-standards-configuration/action.yml b/apply-configuration/action.yml similarity index 54% rename from .github/actions/apply-coding-standards-configuration/action.yml rename to apply-configuration/action.yml index c5c58ebc3c..ea4e48cb8d 100644 --- a/.github/actions/apply-coding-standards-configuration/action.yml +++ b/apply-configuration/action.yml @@ -6,12 +6,14 @@ runs: using: composite steps: - name: Install Python + id: cs-install-python uses: actions/setup-python@v5 with: python-version: 3.9 + update-environment: false - name: Install dependencies shell: bash - run: python -m pip install -r ${GITHUB_ACTION_PATH}/../../../scripts/configuration/requirements.txt + run: ${{ steps.cs-install-python.outputs.python-path }} -m pip install -r ${GITHUB_ACTION_PATH}/../scripts/configuration/requirements.txt - name: Process files shell: bash - run: python ${GITHUB_ACTION_PATH}/../../../scripts/configuration/process_coding_standards_config.py + run: ${{ steps.cs-install-python.outputs.python-path }} ${GITHUB_ACTION_PATH}/../scripts/configuration/process_coding_standards_config.py From c94e7189cb599098653ecb1444e143056dba1034 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 22 Oct 2024 13:01:39 +0100 Subject: [PATCH 12/13] Address LD_LIBRARY_PATH issue --- apply-configuration/action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apply-configuration/action.yml b/apply-configuration/action.yml index ea4e48cb8d..bc12db4f60 100644 --- a/apply-configuration/action.yml +++ b/apply-configuration/action.yml @@ -13,7 +13,14 @@ runs: update-environment: false - name: Install dependencies shell: bash - run: ${{ steps.cs-install-python.outputs.python-path }} -m pip install -r ${GITHUB_ACTION_PATH}/../scripts/configuration/requirements.txt + run: | + install_dir=$(dirname $(dirname "${{ steps.cs-install-python.outputs.python-path }}")) + if [[ -z "$LD_LIBRARY_PATH" ]]; then + export LD_LIBRARY_PATH="$install_dir/lib" + else + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$install_dir/lib" + fi + ${{ steps.cs-install-python.outputs.python-path }} -m pip install -r ${GITHUB_ACTION_PATH}/../scripts/configuration/requirements.txt - name: Process files shell: bash run: ${{ steps.cs-install-python.outputs.python-path }} ${GITHUB_ACTION_PATH}/../scripts/configuration/process_coding_standards_config.py From 2180087c2a7ae458cc87b81f67bdb4a4614ff267 Mon Sep 17 00:00:00 2001 From: Luke Cartey Date: Tue, 22 Oct 2024 13:12:57 +0100 Subject: [PATCH 13/13] Combine steps to apply LD_LIBRARY_PATH to both steps --- apply-configuration/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apply-configuration/action.yml b/apply-configuration/action.yml index bc12db4f60..89a702b72a 100644 --- a/apply-configuration/action.yml +++ b/apply-configuration/action.yml @@ -11,7 +11,7 @@ runs: with: python-version: 3.9 update-environment: false - - name: Install dependencies + - name: Install dependencies and process files shell: bash run: | install_dir=$(dirname $(dirname "${{ steps.cs-install-python.outputs.python-path }}")) @@ -21,6 +21,4 @@ runs: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$install_dir/lib" fi ${{ steps.cs-install-python.outputs.python-path }} -m pip install -r ${GITHUB_ACTION_PATH}/../scripts/configuration/requirements.txt - - name: Process files - shell: bash - run: ${{ steps.cs-install-python.outputs.python-path }} ${GITHUB_ACTION_PATH}/../scripts/configuration/process_coding_standards_config.py + ${{ steps.cs-install-python.outputs.python-path }} ${GITHUB_ACTION_PATH}/../scripts/configuration/process_coding_standards_config.py \ No newline at end of file