Skip to content

Commit ed8052c

Browse files
committed
Port 7 workflow files from master branch, adapting them for the PG14
base of IVORYSQL_REL_1_STABLE
1 parent 03a588d commit ed8052c

7 files changed

Lines changed: 434 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
6+
pull_request:
7+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: dependancy - linux
19+
if: ${{ matrix.os == 'ubuntu-latest' }}
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y build-essential git lcov bison flex \
23+
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
24+
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
25+
libreadline-dev libedit-dev uuid-dev libossp-uuid-dev \
26+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
27+
libicu-dev
28+
- name: configure - linux
29+
if: ${{ matrix.os == 'ubuntu-latest' }}
30+
run: |
31+
./configure \
32+
--enable-cassert --enable-debug --enable-rpath --with-tcl \
33+
--with-python --with-gssapi --with-pam --with-ldap \
34+
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
35+
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
36+
--with-icu
37+
- name: compile
38+
run: make CFLAGS="$CFLAGS -Wshadow=compatible-local -Werror=missing-variable-declarations -Werror=maybe-uninitialized -Werror=unused-value -Werror=unused-but-set-variable -Werror=missing-prototypes -Werror=unused-variable"
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: "Build and Test"
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
regression:
8+
runs-on: ubuntu-18.04
9+
strategy:
10+
matrix:
11+
container-os: [centos-7, centos-8]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Build ${{ matrix.container-os }} Docker
16+
if: ${{ matrix.container-os == 'centos-7' }}
17+
run: |
18+
docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF
19+
FROM centos:7
20+
RUN rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
21+
RUN yum install -y epel-release centos-release-scl
22+
RUN yum groups mark install "Development Tools"
23+
RUN yum groupinstall -y "Development Tools"
24+
RUN yum install -y \
25+
lcov uuid-devel readline-devel zlib-devel openssl-devel pam-devel \
26+
libxml2-devel libxslt-devel openldap-devel tcl-devel tk-devel python-devel \
27+
python3-devel lz4 lz4-devel cyrus-sasl-gssapi \
28+
llvm-toolset-7 llvm-toolset-7-llvm-devel llvm5.0-devel \
29+
libicu-devel e2fsprogs-devel selinux-policy systemd-devel \
30+
libuuid-devel cppcheck \
31+
perl-devel perl-ExtUtils-Embed perl-IPC-Run perl-Time-HiRes perl-Test-Simple
32+
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
33+
RUN useradd -m -d /home/ivorysql ivorysql
34+
EOF
35+
- name: Build ${{ matrix.container-os }} Docker
36+
if: ${{ matrix.container-os == 'centos-8' }}
37+
run: |
38+
docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF
39+
FROM centos:8
40+
RUN cd /etc/yum.repos.d/ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
41+
RUN dnf install -y epel-release
42+
RUN dnf groupinstall -y "Development Tools"
43+
RUN dnf install -y \
44+
llvm-toolset llvm-devel lz4 lz4-devel lz4-libs clang-devel \
45+
krb5-devel libselinux-devel libxml2-devel cyrus-sasl-gssapi \
46+
libicu-devel e2fsprogs-devel selinux-policy systemd-devel \
47+
libxslt-devel openldap-devel openssl-devel pam-devel \
48+
libuuid-devel python3-devel readline-devel tcl-devel zlib-devel \
49+
perl perl-devel perl-ExtUtils-Embed
50+
RUN dnf install -y --enablerepo=*ower*ools perl-IPC-Run perl-Time-HiRes perl-Test-Simple uuid-devel
51+
RUN useradd -m -d /home/ivorysql ivorysql
52+
EOF
53+
- name: Create and Start iv-${{ matrix.container-os }}-container container
54+
run: |
55+
docker create -t -u ivorysql \
56+
--name iv-${{ matrix.container-os }}-container \
57+
-v ${GITHUB_WORKSPACE}:/IvorySQL:rw \
58+
ivorysql-${{ matrix.container-os }} bash &&
59+
docker start iv-${{ matrix.container-os }}-container
60+
- name: configure - ${{ matrix.container-os }}
61+
run: |
62+
docker exec -u ivorysql \
63+
iv-${{ matrix.container-os }}-container bash -c "
64+
tar -c --exclude .git* -C / IvorySQL | tar -x -C /home/ivorysql/ &&
65+
cd /home/ivorysql/IvorySQL &&
66+
./configure \
67+
--enable-cassert --enable-debug --enable-rpath --with-tcl \
68+
--with-python --with-gssapi --with-pam --with-ldap \
69+
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
70+
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
71+
--with-icu
72+
"
73+
- name: compile
74+
run: |
75+
docker exec -u ivorysql \
76+
iv-${{ matrix.container-os }}-container bash -c "
77+
cd /home/ivorysql/IvorySQL && make
78+
"
79+
- name: regression
80+
run: |
81+
docker exec -u ivorysql \
82+
iv-${{ matrix.container-os }}-container bash -c "
83+
cd /home/ivorysql/IvorySQL && make check-world
84+
"
85+
- name: collect files
86+
if: failure()
87+
run: |
88+
docker exec -u 0 \
89+
iv-${{ matrix.container-os }}-container bash -c "
90+
cd /home/ivorysql/IvorySQL &&
91+
find . \( -name \*.diffs -or -name regression.out -or -path \*/tmp_check/log \) -print0 |
92+
xargs -0 tar -czf /IvorySQL/regression.tar.gz
93+
"
94+
- name: upload regression files
95+
if: failure()
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: results
99+
path: ${{ github.workspace }}/regression.tar.gz
100+
101+
- name: Cleanup
102+
if: always()
103+
run: |
104+
docker stop iv-${{ matrix.container-os }}-container
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: contrib_regression
2+
3+
on:
4+
push:
5+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
6+
pull_request:
7+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
8+
9+
jobs:
10+
contrib_regression:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: dependancy
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y build-essential git lcov bison flex \
19+
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
20+
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
21+
libreadline-dev libedit-dev uuid-dev libossp-uuid-dev \
22+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
23+
libicu-dev
24+
- name: configure - linux
25+
run: |
26+
curl -L -o cpanm http://cpanmin.us && chmod +x cpanm && \
27+
./cpanm --sudo IPC::Run && \
28+
./configure \
29+
--prefix=$PWD/inst \
30+
--enable-cassert --enable-debug --enable-rpath --with-tcl \
31+
--with-python --with-gssapi --with-pam --with-ldap \
32+
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
33+
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
34+
--with-icu
35+
- name: compile
36+
run: make && make install
37+
38+
- name: contrib_regression
39+
run: |
40+
cd contrib && make oracle-check
41+
make check
42+
43+
- name: collect files
44+
if: failure()
45+
run: |
46+
find . \( -name "*.diffs" -or -name "pg_regression.out" -or -path \*/tmp_check/log -or -path \*src/test/regress/log \) -print0 |
47+
xargs -0 tar -czf pg_regression.tar.gz
48+
- name: upload pg_regression files
49+
if: failure()
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: results
53+
path: ${{ github.workspace }}/pg_regression.tar.gz
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Auto Assign Issue on Command
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
assign_on_command:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
contents: read
13+
steps:
14+
- name: Assign to user on /assign command
15+
uses: actions/github-script@v6
16+
with:
17+
github-token: ${{secrets.IVORY_TOKEN}}
18+
script: |
19+
const commentBody = context.payload.comment.body.trim().toLowerCase();
20+
const commenter = context.payload.comment.user.login;
21+
const issueNumber = context.issue.number;
22+
const repoOwner = context.repo.owner;
23+
const repoName = context.repo.repo;
24+
if (commentBody === '/assign') {
25+
console.log(`User @${commenter} commented "/assign" on issue #${issueNumber}. Attempting to assign.`);
26+
if (commenter.endsWith('[bot]') || commenter === 'github-actions[bot]') {
27+
console.log(`Skipping assignment for bot user: ${commenter}`);
28+
return;
29+
}
30+
const { data: issue } = await github.rest.issues.get({
31+
owner: repoOwner,
32+
repo: repoName,
33+
issue_number: issueNumber
34+
});
35+
if (issue.assignees && issue.assignees.some(a => a.login === commenter)) {
36+
console.log(`Issue #${issueNumber} is already assigned to @${commenter}. No action needed.`);
37+
return;
38+
}
39+
if (issue.state === 'closed') {
40+
console.log(`Issue #${issueNumber} is closed. No assignment will be made.`);
41+
await github.rest.issues.createComment({
42+
owner: repoOwner,
43+
repo: repoName,
44+
issue_number: issueNumber,
45+
body: `Hi @${commenter}, issue #${issueNumber} is closed and cannot be assigned.`
46+
});
47+
return;
48+
}
49+
try {
50+
await github.rest.issues.addAssignees({
51+
owner: repoOwner,
52+
repo: repoName,
53+
issue_number: issueNumber,
54+
assignees: [commenter]
55+
});
56+
console.log(`Successfully assigned issue #${issueNumber} to @${commenter}.`);
57+
} catch (error) {
58+
console.error(`Error assigning issue #${issueNumber} to @${commenter}:`, error);
59+
await github.rest.issues.createComment({
60+
owner: repoOwner,
61+
repo: repoName,
62+
issue_number: issueNumber,
63+
body: `Hi @${commenter}, I encountered an error trying to assign you to issue #${issueNumber}. Please check permissions or assign manually. \nError: ${error.message}`
64+
});
65+
}
66+
} else {
67+
console.log(`Comment by @${commenter} on issue #${issueNumber} was not an "/assign" command. Body: "${context.payload.comment.body.trim()}"`);
68+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: oracle_pg_regression
2+
3+
on:
4+
push:
5+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
6+
pull_request:
7+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
8+
9+
jobs:
10+
oracle_pg_regression:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: dependancy
19+
if: ${{ matrix.os == 'ubuntu-latest' }}
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y build-essential git lcov bison flex \
23+
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
24+
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
25+
libreadline-dev libedit-dev uuid-dev libossp-uuid-dev \
26+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
27+
libicu-dev
28+
- name: configure - linux
29+
if: ${{ matrix.os == 'ubuntu-latest' }}
30+
run: |
31+
curl -L -o cpanm http://cpanmin.us && chmod +x cpanm && \
32+
./cpanm --sudo IPC::Run && \
33+
./configure \
34+
--prefix=$PWD/inst \
35+
--enable-cassert --enable-debug --enable-rpath --with-tcl \
36+
--with-python --with-gssapi --with-pam --with-ldap \
37+
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
38+
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
39+
--with-icu
40+
- name: compile
41+
run: make && make install
42+
43+
- name: pg_regression
44+
run: make check
45+
46+
- name: oracle_pg_regression
47+
run: make oracle-pg-check
48+
49+
- name: collect files
50+
if: failure()
51+
run: |
52+
find . \( -name "*.diffs" -or -name "oracle_pg_regression.out" -or -path \*/tmp_check/log -or -path \*src/test/regress/log \) -print0 |
53+
xargs -0 tar -czf oracle_pg_regression.tar.gz
54+
- name: upload oracle_pg_regression files
55+
if: failure()
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: results
59+
path: ${{ github.workspace }}/oracle_pg_regression.tar.gz
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: oracle_regression
2+
3+
on:
4+
push:
5+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
6+
pull_request:
7+
branches: [ master , IVORY_REL_4_STABLE , IVORYSQL_REL_1_STABLE]
8+
9+
jobs:
10+
oracle_regression:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: dependancy
19+
if: ${{ matrix.os == 'ubuntu-latest' }}
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y build-essential git lcov bison flex \
23+
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
24+
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
25+
libreadline-dev libedit-dev uuid-dev libossp-uuid-dev \
26+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
27+
libicu-dev
28+
- name: configure - linux
29+
if: ${{ matrix.os == 'ubuntu-latest' }}
30+
run: |
31+
curl -L -o cpanm http://cpanmin.us && chmod +x cpanm && \
32+
./cpanm --sudo IPC::Run && \
33+
./configure \
34+
--prefix=$PWD/inst \
35+
--enable-cassert --enable-debug --enable-rpath --with-tcl \
36+
--with-python --with-gssapi --with-pam --with-ldap \
37+
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
38+
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
39+
--with-icu
40+
- name: compile
41+
run: make && make install
42+
43+
- name: oracle_regression
44+
run: make oracle-check-world
45+
46+
- name: collect files
47+
if: failure()
48+
run: |
49+
find . \( -name "*.diffs" -or -name "oracle_regression.out" -or -path \*/tmp_check/log -or -path \*src/test/regress/log \) -print0 |
50+
xargs -0 tar -czf oracle_regression.tar.gz
51+
- name: upload oracle_regression files
52+
if: failure()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: results
56+
path: ${{ github.workspace }}/oracle_regression.tar.gz

0 commit comments

Comments
 (0)