Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f2f373

Browse files
committed
Add a Linux build workflow
1 parent7792b98 commit5f2f373

14 files changed

+197
-263
lines changed

‎.github/workflows/build-linux.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name:Linux
2+
on:
3+
push:
4+
branches:
5+
-"**"
6+
pull_request:
7+
branches:
8+
-main
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
inputs:
12+
build_versions:
13+
description:Build versions
14+
default:11, 12, 13, 14, 15
15+
test_mode:
16+
description:Test mode
17+
default:basic
18+
jobs:
19+
build:
20+
name:${{ format('pg_probackup ({0}, v{1})', 'ubuntu-22.04', matrix.pg_version) }}
21+
strategy:
22+
matrix:
23+
pg_version:${{ fromJSON(github.event.inputs.build_versions && format('[{0}]', github.event.inputs.build_versions) || '[11, 12, 13, 14, 15]') }}
24+
fail-fast:false
25+
runs-on:
26+
-ubuntu-22.04
27+
env:
28+
PG_VERSION:${{ matrix.pg_version }}
29+
PG_BRANCH:${{ matrix.pg_version == 16 && 'master' || format('REL_{0}_STABLE', matrix.pg_version) }}
30+
PTRACK_PATCH_PG_BRANCH:${{ matrix.pg_version == 16 && 'master' || format('REL_{0}_STABLE', matrix.pg_version) }}
31+
PG_BASE:${{ github.workspace }}/pgsql
32+
PG_CONFIG:${{ github.workspace }}/pgsql/bin/pg_config
33+
steps:
34+
-uses:actions/checkout@v2
35+
-name:Install dependencies
36+
run:sudo ci/install-deps.sh
37+
-name:Build and install
38+
run:ci/build-install.sh
39+
-name:Test
40+
run:ci/test.sh
41+
continue-on-error:${{ matrix.pg_version == 16 }}
42+

‎.github/workflows/build-windows.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name:Windows
2+
on:
3+
push:
4+
branches:
5+
-"**"
6+
pull_request:
7+
branches:
8+
-main
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
jobs:
12+
build:
13+
name:pg_probackup (windows-2022, v15)
14+
runs-on:
15+
-windows-2022
16+
steps:
17+
-uses:actions/checkout@v2
18+
-name:Install dependencies
19+
run:ci/install-deps.ps1
20+
-name:Build and install
21+
run:ci/build-install.ps1
22+
-name:Test
23+
run:ci/test.ps1
24+

‎.github/workflows/build.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

‎.travis.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
[![Linux](https://github.com/postgrespro/pg_probackup/actions/workflows/build-linux.yml/badge.svg)](https://github.com/postgrespro/pg_probackup/actions/workflows/build-linux.yml)
2+
[![Windows](https://github.com/postgrespro/pg_probackup/actions/workflows/build-windows.yml/badge.svg)](https://github.com/postgrespro/pg_probackup/actions/workflows/build-windows.yml)
13
[![GitHub release](https://img.shields.io/github/v/release/postgrespro/pg_probackup?include_prereleases)](https://github.com/postgrespro/pg_probackup/releases/latest)
2-
[![Build Status](https://travis-ci.com/postgrespro/pg_probackup.svg?branch=master)](https://travis-ci.com/postgrespro/pg_probackup)
34

45
#pg_probackup
56

‎ci/build-install.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
git clone-b REL_15_STABLE https://github.com/postgres/postgres.git
2+
# Copy ptrack to contrib to build the ptrack extension
3+
# Convert line breaks in the patch file to LF otherwise the patch doesn't apply
4+
git clone-b master--depth1 https://github.com/postgrespro/ptrack.git
5+
Copy-Item-Path ptrack-Destination postgres\contrib-Recurse
6+
(Get-Content ptrack\patches\REL_15_STABLE-ptrack-core.diff-Raw).Replace("`r`n","`n")|Set-Content ptrack\patches\REL_15_STABLE-ptrack-core.diff-Force-NoNewline
7+
cd postgres
8+
git apply-3 ../ptrack/patches/REL_15_STABLE-ptrack-core.diff
9+
10+
# Pacman packages are installed into MSYS
11+
$env:PATH+=";C:\msys64\usr\bin"
12+
13+
# Build Postgres
14+
cd"$env:GITHUB_WORKSPACE\postgres\src\tools\msvc"
15+
(Get-Content config_default.pl)-Replace"zlib *=>(.*?)(?=,? *#)","zlib => 'C:\dep\zlib'"|Set-Content config.pl
16+
cmd.exe/s/c"`"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" amd64 && .\build.bat"
17+
If (-Not$?) {exit1}
18+
# Install Postgres
19+
.\install.bat postgres_install
20+
If (-Not$?) {exit1}
21+
22+
# Build Pg_probackup
23+
cd"$env:GITHUB_WORKSPACE"
24+
cmd.exe/s/c"`"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat`" amd64 && perl .\gen_probackup_project.pl`"$env:GITHUB_WORKSPACE\postgres`""
25+
Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#!/usr/bin/envbash
1+
#!/usr/bin/envsh
22

3-
set -xe
3+
set -x
44

55
if [-z${PG_VERSION+x} ];then
66
echo PG_VERSION is not set!
@@ -16,13 +16,10 @@ if [ -z ${PTRACK_PATCH_PG_BRANCH+x} ]; then
1616
PTRACK_PATCH_PG_BRANCH=OFF
1717
fi
1818

19-
# fix
20-
sudo chown -R travis /home/travis/.ccache
21-
22-
export PGHOME=/pg
19+
export PG_SRC=$PWD/postgres
2320

2421
# Clone Postgres
25-
echo"############### Getting Postgres sources:"
22+
echo"############### Getting Postgres sources..."
2623
git clone https://github.com/postgres/postgres.git -b$PG_BRANCH --depth=1
2724

2825
# Clone ptrack
@@ -33,34 +30,36 @@ else
3330
export PG_PROBACKUP_PTRACK=OFF
3431
fi
3532

33+
cd postgres
3634
# Compile and install Postgres
37-
echo"############### Compiling Postgres:"
38-
cd postgres# Go to postgres dir
35+
echo"############### Compiling Postgres..."
3936
if ["$PG_PROBACKUP_PTRACK"="ON" ];then
4037
git apply -3 contrib/ptrack/patches/${PTRACK_PATCH_PG_BRANCH}-ptrack-core.diff
4138
fi
42-
CC='ccache gcc' CFLAGS="-Og" ./configure --prefix=$PGHOME \
43-
--cache-file=~/.ccache/configure-cache \
39+
CFLAGS="-Og" ./configure --prefix=$PG_BASE \
4440
--enable-debug --enable-cassert --enable-depend \
4541
--enable-tap-tests --enable-nls
4642
make -s -j$(nproc) install
4743
make -s -j$(nproc) -C contrib/ install
4844

49-
# Override default Postgres instance
50-
export PATH=$PGHOME/bin:$PATH
51-
export LD_LIBRARY_PATH=$PGHOME/lib
52-
export PG_CONFIG=$(which pg_config)
45+
export PATH=$PATH:$PG_BASE/bin
46+
export LD_LIBRARY_PATH=$PG_BASE/lib
5347

5448
if ["$PG_PROBACKUP_PTRACK"="ON" ];then
55-
echo"############### Compiling Ptrack:"
49+
echo"############### Compiling Ptrack..."
5650
make -C contrib/ptrack install
5751
fi
5852

5953
# Get amcheck if missing
6054
if [!-d"contrib/amcheck" ];then
61-
echo"############### Getting missing amcheck:"
55+
echo"############### Getting missing amcheck..."
6256
git clone https://github.com/petergeoghegan/amcheck.git --depth=1 contrib/amcheck
6357
make -C contrib/amcheck install
6458
fi
6559

66-
pip3 install testgres
60+
cd ..
61+
# Build and install pg_probackup (using PG_CPPFLAGS and SHLIB_LINK for gcov)
62+
echo"############### Compiling and installing pg_probackup..."
63+
# make USE_PGXS=1 PG_CPPFLAGS="-coverage" SHLIB_LINK="-coverage" top_srcdir=$CUSTOM_PG_SRC install
64+
make install USE_PGXS=1 top_srcdir=$PG_SRC PG_CONFIG=$PG_BASE/bin/pg_config
65+

‎ci/install-deps.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
$env:PATH+=";C:\msys64\usr\bin"
2+
pacman-S--noconfirm--needed bison flex
3+
4+
git clone-b v1.2.11--depth1 https://github.com/madler/zlib.git
5+
cd zlib
6+
cmake-DCMAKE_INSTALL_PREFIX:PATH=C:\dep\zlib-G"Visual Studio 17 2022" .
7+
cmake--build.--config Release--target ALL_BUILD
8+
cmake--build.--config Release--target INSTALL
9+
Copy-Item"C:\dep\zlib\lib\zlibstatic.lib"-Destination"C:\dep\zlib\lib\zdll.lib"
10+
Copy-Item"C:\dep\zlib\bin\zlib.dll"-Destination"C:\dep\zlib\lib"
11+
If (-Not$?) {exit1}
12+
13+
#Install Testgres
14+
cd"$env:GITHUB_WORKSPACE"
15+
git clone-b no-port-for--single-branch--depth1 https://github.com/postgrespro/testgres.git
16+
cd testgres
17+
python setup.py install
18+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp