Skip to content

Commit

Permalink
Disable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Apr 1, 2024
1 parent 7ea569e commit f0b85b8
Show file tree
Hide file tree
Showing 24 changed files with 1,879 additions and 1,879 deletions.
254 changes: 127 additions & 127 deletions .github/workflows/code-coverage-test.yml
Original file line number Diff line number Diff line change
@@ -1,139 +1,139 @@
name: code-coverage-test
on: [pull_request]
# name: code-coverage-test
# on: [pull_request]

jobs:
build:
name: coverage-test
runs-on: ubuntu-22.04
steps:
- name: Clone postgres repository
uses: actions/checkout@v2
with:
repository: 'postgres/postgres'
ref: 'REL_15_STABLE'
# jobs:
# build:
# name: coverage-test
# runs-on: ubuntu-22.04
# steps:
# - name: Clone postgres repository
# uses: actions/checkout@v2
# with:
# repository: 'postgres/postgres'
# ref: 'REL_15_STABLE'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common \
postgresql postgresql*
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \
zlib1g-dev libssl-dev libpam0g-dev bison flex \
libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \
llvm-11 llvm-11-dev libselinux1-dev python3-dev uuid-dev \
liblz4-dev lcov
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
/etc/postgresql
sudo rm -f /usr/bin/pg_config
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'
# - name: Install dependencies
# run: |
# sudo apt-get update
# sudo apt purge postgresql-client-common postgresql-common \
# postgresql postgresql*
# sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \
# zlib1g-dev libssl-dev libpam0g-dev bison flex \
# libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \
# libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
# libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \
# llvm-11 llvm-11-dev libselinux1-dev python3-dev uuid-dev \
# liblz4-dev lcov
# sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
# /usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
# /etc/postgresql
# sudo rm -f /usr/bin/pg_config
# sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
# sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'

- name: Create pgsql dir
run: mkdir -p /opt/pgsql
# - name: Create pgsql dir
# run: mkdir -p /opt/pgsql

- name: Build postgres
run: |
export PATH="/opt/pgsql/bin:$PATH"
./configure '--build=x86_64-linux-gnu' '--prefix=/usr' \
'--includedir=${prefix}/include' '--enable-coverage' \
'--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' \
'--sysconfdir=/etc' '--localstatedir=/var' '--with-icu' \
'--libdir=${prefix}/lib/x86_64-linux-gnu' '--with-tcl' \
'--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--with-perl' \
'--with-python' '--with-pam' '--with-openssl' '--with-libxml' \
'--with-libxslt' 'PYTHON=/usr/bin/python3' '--enable-nls' \
'--mandir=/usr/share/postgresql/15/man' '--enable-thread-safety' \
'--docdir=/usr/share/doc/postgresql-doc-15' '--enable-dtrace' \
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share' \
'--datadir=/usr/share/postgresql/15' '--with-uuid=e2fs' \
'--bindir=/usr/lib/postgresql/15/bin' '--with-gnu-ld' \
'--libdir=/usr/lib/x86_64-linux-gnu' '--enable-tap-tests' \
'--libexecdir=/usr/lib/postgresql' '--enable-debug' \
'--includedir=/usr/include/postgresql' '--disable-rpath' \
'--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' \
'--with-llvm''TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' \
'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11' \
'--with-systemd' 'MKDIR_P=/bin/mkdir -p' '--with-selinux' \
'PROVE=/usr/bin/prove' '--with-gssapi' '--with-ldap' \
'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' \
'build_alias=x86_64-linux-gnu' \
'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' \
'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
make world
sudo make install-world
# - name: Build postgres
# run: |
# export PATH="/opt/pgsql/bin:$PATH"
# ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' \
# '--includedir=${prefix}/include' '--enable-coverage' \
# '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' \
# '--sysconfdir=/etc' '--localstatedir=/var' '--with-icu' \
# '--libdir=${prefix}/lib/x86_64-linux-gnu' '--with-tcl' \
# '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--with-perl' \
# '--with-python' '--with-pam' '--with-openssl' '--with-libxml' \
# '--with-libxslt' 'PYTHON=/usr/bin/python3' '--enable-nls' \
# '--mandir=/usr/share/postgresql/15/man' '--enable-thread-safety' \
# '--docdir=/usr/share/doc/postgresql-doc-15' '--enable-dtrace' \
# '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share' \
# '--datadir=/usr/share/postgresql/15' '--with-uuid=e2fs' \
# '--bindir=/usr/lib/postgresql/15/bin' '--with-gnu-ld' \
# '--libdir=/usr/lib/x86_64-linux-gnu' '--enable-tap-tests' \
# '--libexecdir=/usr/lib/postgresql' '--enable-debug' \
# '--includedir=/usr/include/postgresql' '--disable-rpath' \
# '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' \
# '--with-llvm''TAR=/bin/tar' 'XSLTPROC=xsltproc --nonet' \
# 'LLVM_CONFIG=/usr/bin/llvm-config-11' 'CLANG=/usr/bin/clang-11' \
# '--with-systemd' 'MKDIR_P=/bin/mkdir -p' '--with-selinux' \
# 'PROVE=/usr/bin/prove' '--with-gssapi' '--with-ldap' \
# 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' \
# 'build_alias=x86_64-linux-gnu' \
# 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' \
# 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' \
# 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
# make world
# sudo make install-world

- name: Start postgresql cluster
run: |
export PATH="/usr/lib/postgresql/15/bin:$PATH"
sudo cp /usr/lib/postgresql/15/bin/pg_config /usr/bin
initdb -D /opt/pgsql/data
pg_ctl -D /opt/pgsql/data -l logfile start
# - name: Start postgresql cluster
# run: |
# export PATH="/usr/lib/postgresql/15/bin:$PATH"
# sudo cp /usr/lib/postgresql/15/bin/pg_config /usr/bin
# initdb -D /opt/pgsql/data
# pg_ctl -D /opt/pgsql/data -l logfile start

- name: Clone pg_stat_monitor repository
uses: actions/checkout@v2
with:
path: 'src/pg_stat_monitor'
# - name: Clone pg_stat_monitor repository
# uses: actions/checkout@v2
# with:
# path: 'src/pg_stat_monitor'

- name: Build pg_stat_monitor
run: |
make USE_PGXS=1
sudo make USE_PGXS=1 install
working-directory: src/pg_stat_monitor
# - name: Build pg_stat_monitor
# run: |
# make USE_PGXS=1
# sudo make USE_PGXS=1 install
# working-directory: src/pg_stat_monitor

- name: Load pg_stat_monitor library and Restart Server
run: |
export PATH="/usr/lib/postgresql/15/bin:$PATH"
pg_ctl -D /opt/pgsql/data -l logfile stop
echo "shared_preload_libraries = 'pg_stat_monitor'" \
>> /opt/pgsql/data/postgresql.conf
pg_ctl -D /opt/pgsql/data -l logfile start
working-directory: src/pg_stat_monitor
# - name: Load pg_stat_monitor library and Restart Server
# run: |
# export PATH="/usr/lib/postgresql/15/bin:$PATH"
# pg_ctl -D /opt/pgsql/data -l logfile stop
# echo "shared_preload_libraries = 'pg_stat_monitor'" \
# >> /opt/pgsql/data/postgresql.conf
# pg_ctl -D /opt/pgsql/data -l logfile start
# working-directory: src/pg_stat_monitor

- name: Start pg_stat_monitor_tests & Run code coverage
run: |
make installcheck
/usr/lib/postgresql/15/bin/psql -d postgres -p 5432 -c "\list"
gcov -abcfu pg_stat_monitor.c
gcov -abcfu guc.c
gcov -abcfu hash_query.c
sudo chmod -R ugo+rwx *.gcov*
working-directory: src/pg_stat_monitor
# - name: Start pg_stat_monitor_tests & Run code coverage
# run: |
# make installcheck
# /usr/lib/postgresql/15/bin/psql -d postgres -p 5432 -c "\list"
# gcov -abcfu pg_stat_monitor.c
# gcov -abcfu guc.c
# gcov -abcfu hash_query.c
# sudo chmod -R ugo+rwx *.gcov*
# working-directory: src/pg_stat_monitor

- name: Upload
uses: codecov/codecov-action@v2
with:
verbose: true
working-directory: ./src/pg_stat_monitor
files: ./pg_stat_monitor.c.gcov,./hash_query.c.gcov,./guc.c.gcov
# - name: Upload
# uses: codecov/codecov-action@v2
# with:
# verbose: true
# working-directory: ./src/pg_stat_monitor
# files: ./pg_stat_monitor.c.gcov,./hash_query.c.gcov,./guc.c.gcov

- name: Change dir permissions on fail
if: ${{ failure() }}
run: |
sudo chmod -R ugo+rwx t
sudo chmod -R ugo+rwx tmp_check
exit 2 # regenerate error so that we can upload files in next step
working-directory: src/pg_stat_monitor
# - name: Change dir permissions on fail
# if: ${{ failure() }}
# run: |
# sudo chmod -R ugo+rwx t
# sudo chmod -R ugo+rwx tmp_check
# exit 2 # regenerate error so that we can upload files in next step
# working-directory: src/pg_stat_monitor

- name: Upload logs on fail
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: Regressions diff and postgresql log
path: |
src/pg_stat_monitor/regression.diffs
src/pg_stat_monitor/regression.out
src/pg_stat_monitor/logfile
src/pg_stat_monitor/t/results/
src/pg_stat_monitor/tmp_check/log/
!src/pg_stat_monitor/tmp_check/**/archives/*
!src/pg_stat_monitor/tmp_check/**/backup/*
!src/pg_stat_monitor/tmp_check/**/pgdata/*
!src/pg_stat_monitor/tmp_check/**/archives/
!src/pg_stat_monitor/tmp_check/**/backup/
!src/pg_stat_monitor/tmp_check/**/pgdata/
if-no-files-found: warn
retention-days: 3
# - name: Upload logs on fail
# if: ${{ failure() }}
# uses: actions/upload-artifact@v2
# with:
# name: Regressions diff and postgresql log
# path: |
# src/pg_stat_monitor/regression.diffs
# src/pg_stat_monitor/regression.out
# src/pg_stat_monitor/logfile
# src/pg_stat_monitor/t/results/
# src/pg_stat_monitor/tmp_check/log/
# !src/pg_stat_monitor/tmp_check/**/archives/*
# !src/pg_stat_monitor/tmp_check/**/backup/*
# !src/pg_stat_monitor/tmp_check/**/pgdata/*
# !src/pg_stat_monitor/tmp_check/**/archives/
# !src/pg_stat_monitor/tmp_check/**/backup/
# !src/pg_stat_monitor/tmp_check/**/pgdata/
# if-no-files-found: warn
# retention-days: 3
28 changes: 14 additions & 14 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: cppcheck-action-test
on: [push]
# name: cppcheck-action-test
# on: [push]

jobs:
build:
name: cppcheck-test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# jobs:
# build:
# name: cppcheck-test
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2

- name: install cppcheck
run: sudo apt-get install cppcheck
# - name: install cppcheck
# run: sudo apt-get install cppcheck

- name: Execute linter check with cppcheck
run: |
set -x
cppcheck --enable=all --inline-suppr --template='{file}:{line},{severity},{id},{message}' --error-exitcode=1 --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression:pg_stat_monitor.c --check-config .
# - name: Execute linter check with cppcheck
# run: |
# set -x
# cppcheck --enable=all --inline-suppr --template='{file}:{line},{severity},{id},{message}' --error-exitcode=1 --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression:pg_stat_monitor.c --check-config .

Loading

0 comments on commit f0b85b8

Please sign in to comment.