From 03c7998c4fc5db128bb91a963315a85fcf6d5ddc Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Wed, 9 Oct 2024 19:05:50 +0200 Subject: [PATCH] PG-1095 Add check CI workflow --- .github/workflows/check.yaml | 95 +++++++++++++++++++++++++++++++ .gitignore | 3 + typedefs.list | 105 +++++++++++++++++++++++++++++++++++ 3 files changed, 203 insertions(+) create mode 100644 .github/workflows/check.yaml create mode 100644 typedefs.list diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 00000000..afc0a065 --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,95 @@ +name: Checks +on: + pull_request: + +jobs: + cppcheck: + name: Cppcheck + runs-on: ubuntu-22.04 + timeout-minutes: 5 + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: src/pg_tde + + - name: Checkout cppcheck sources + uses: actions/checkout@v4 + with: + repository: "danmar/cppcheck" + ref: "2.13.4" + path: src/cppcheck + + - name: Build and install cppcheck + working-directory: src/cppcheck + run: | + mkdir build + cd build + cmake .. + cmake --build . + sudo cmake --install . + + - name: Execute linter check with cppcheck + working-directory: src/pg_tde + run: | + set -x + cppcheck --enable=all --inline-suppr --template='{file}:{line},{severity},{id},{message}' --error-exitcode=1 --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression:pg_tde.c --check-config . + + format: + name: Format + runs-on: ubuntu-22.04 + timeout-minutes: 5 + + steps: + - name: Clone postgres repository + uses: actions/checkout@v4 + with: + repository: 'postgres/postgres' + ref: 'REL_17_STABLE' + + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'contrib/pg_tde' + + - name: Configure postgres + run: ./configure + + - name: Install perltidy + run: sudo cpan -T SHANCOCK/Perl-Tidy-20230309.tar.gz + + - name: Install pg_bsd_indent + working-directory: src/tools/pg_bsd_indent + run: sudo make install + + - name: Add pg_bsd_indent and pgindent to path + run: | + echo "/usr/local/pgsql/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/src/tools/pgindent" >> $GITHUB_PATH + + - name: Format sources + working-directory: contrib/pg_tde + run: | + make update-typedefs + make indent + + - name: Check files are formatted and no source code changes + working-directory: contrib/pg_tde + run: | + git status + git diff --exit-code + + license: + name: License + runs-on: ubuntu-22.04 + timeout-minutes: 5 + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Check license headers + uses: apache/skywalking-eyes/header@v0.6.0 + with: + token: "" # Prevent comments \ No newline at end of file diff --git a/.gitignore b/.gitignore index d7aeb36f..8e7699f1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ __pycache__ /autom4te.cache /configure~ t/results + +# tools files +typedefs-full.list diff --git a/typedefs.list b/typedefs.list new file mode 100644 index 00000000..bf7cb633 --- /dev/null +++ b/typedefs.list @@ -0,0 +1,105 @@ +BulkInsertStateData +BulkInsertStateData +BulkInsertStateData +BulkInsertStateData +CurlString +FileKeyring +GenericKeyring +HeapPageFreeze +HeapPageFreeze +HeapScanDescData +HeapScanDescData +HeapScanDescData +HeapScanDescData +HeapTupleFreeze +HeapTupleFreeze +IndexDeleteCounts +IndexDeleteCounts +IndexFetchHeapData +IndexFetchHeapData +InternalKey +JsonKeyringState +JsonVaultRespState +KeyProviders +KeyringProvideRecord +KeyringProviderXLRecord +LVPagePruneState +LVRelState +LVRelState +LVSavedErrInfo +LVSavedErrInfo +LogicalRewriteMappingData +LogicalRewriteMappingData +PendingMapEntryDelete +PruneFreezeResult +RelKeyCache +RelKeyCacheRec +RelKeyData +RewriteMappingDataEntry +RewriteMappingDataEntry +RewriteMappingFile +RewriteMappingFile +RewriteStateData +RewriteStateData +RewriteStateData +RewriteStateData *RewriteState; +TDEBufferHeapTupleTableSlot +TDEFileHeader +TDEKeyringRoutine +TDELocalState +TDEMapEntry +TDEMapFilePath +TDEPrincipalKey +TDEPrincipalKeyId +TDEPrincipalKeyInfo +TDEShmemSetupRoutine +TdeCreateEvent +TdeKeyProviderInfoSharedState +TdePrincipalKeySharedState +TdePrincipalKeylocalState +TdeSharedState +VaultV2Keyring +XLogExtensionInstall +XLogPrincipalKeyRotate +XLogRelKey +itemIdCompactData +itemIdCompactData +keyData +keyInfo +keyName +xl_multi_insert_tuple +xl_multi_insert_tuple +xl_tdeheap_confirm +xl_tdeheap_confirm +xl_tdeheap_delete +xl_tdeheap_delete +xl_tdeheap_freeze_page +xl_tdeheap_freeze_plan +xl_tdeheap_header +xl_tdeheap_header +xl_tdeheap_inplace +xl_tdeheap_inplace +xl_tdeheap_insert +xl_tdeheap_insert +xl_tdeheap_lock +xl_tdeheap_lock +xl_tdeheap_lock_updated +xl_tdeheap_lock_updated +xl_tdeheap_multi_insert +xl_tdeheap_multi_insert +xl_tdeheap_new_cid +xl_tdeheap_new_cid +xl_tdeheap_prune +xl_tdeheap_prune +xl_tdeheap_rewrite_mapping +xl_tdeheap_rewrite_mapping +xl_tdeheap_truncate +xl_tdeheap_truncate +xl_tdeheap_update +xl_tdeheap_update +xl_tdeheap_vacuum +xl_tdeheap_visible +xl_tdeheap_visible +xlhp_freeze_plan +xlhp_freeze_plans +xlhp_prune_items \ No newline at end of file