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

Switch from Travis to GitHub Actions#32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asavchkov merged 12 commits intomasterfromgithub-actions
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
b8a3eed
Switch from Travis to GitHub Actions
postgres-devJan 23, 2023
7bb1c9d
Typo
postgres-devJan 24, 2023
3a41656
Continue on error only for experimental jobs
postgres-devJan 24, 2023
1577a6d
Don't terminate other parallel jobs if some fail
postgres-devJan 24, 2023
e854bf1
Link the status badge to the workflow results
postgres-devJan 26, 2023
de4e659
Merge branch 'master' into github-actions
asavchkovAug 18, 2023
ad21a71
Refactor the test workflow
asavchkovAug 18, 2023
182e96a
[no ci] Remove the mentioning of the 16th version
asavchkovAug 18, 2023
a7f17a0
Install Postgres from the ptrack Makefile
asavchkovAug 18, 2023
daae165
Run Python tests in parallel only if pytest-xdist is available
asavchkovAug 22, 2023
2eaf70d
Use the default pg_config location
asavchkovAug 23, 2023
44a437a
Typo
asavchkovAug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions.github/workflows/test.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
name: Test

on:
push:
branches:
- "**"
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
Test:
strategy:
matrix:
# pg_version: [15]
pg_version: [11, 12, 13, 14, 15]
os: [ubuntu-22.04]
# tests: [tap]
tests: [tap, python]
# test_mode: [normal, legacy, paranoia]
test_mode: [normal, paranoia]
exclude:
- tests: tap
test_mode: paranoia
- tests: python
test_mode: normal
- tests: python
test_mode: legacy
fail-fast: false
name: ${{ format('Ptrack ({0}, PostgreSQL {1}, {2} tests, {3} mode)', matrix.os, matrix.pg_version, matrix.tests, matrix.test_mode) }}
container:
image: ${{ format('ghcr.io/postgres-dev/{0}:1.0', matrix.os) }}
env:
PG_BRANCH: ${{ format('REL_{0}_STABLE', matrix.pg_version) }}
PGDATA: $HOME/data
TEST_MODE: ${{ matrix.test_mode }}
options: --privileged
steps:
- name: Get Postgres sources
uses: actions/checkout@v3
with:
repository: postgres/postgres
ref: ${{ format('REL_{0}_STABLE', matrix.pg_version) }}
path: postgres
- name: Get Ptrack sources
uses: actions/checkout@v3
with:
path: ptrack
- name: Get Pg_probackup sources
uses: actions/checkout@v3
with:
repository: postgrespro/pg_probackup
path: pg_probackup
- name: Apply ptrack patches
run: make patch top_builddir=../postgres
working-directory: ptrack
- name: Install Postgres
run: |
make install-postgres top_builddir=$GITHUB_WORKSPACE/postgres prefix=$HOME/pgsql &&
echo $HOME/pgsql/bin >> $GITHUB_PATH
working-directory: ptrack
- name: Install Ptrack
run: make install USE_PGXS=1 PG_CPPFLAGS=-coverage SHLIB_LINK=-coverage
working-directory: ptrack
- name: Install Pg_probackup
run: make install-pg-probackup USE_PGXS=1 top_srcdir=../postgres
working-directory: ptrack
shell: bash {0}
- name: Install additional packages
run: |
apt update &&
apt install -y python3-pip python3-six python3-pytest python3-pytest-xdist curl &&
pip3 install --no-input testgres
# All steps have been so far executed by root but ptrack tests run from an
# unprivileged user so change some permissions
- name: Adjust the permissions of ptrack test folders
run: |
mkdir pg_probackup/tests/tmp_dirs
chown -R "dev:" pg_probackup ptrack
- name: Test
run: make test-${{ matrix.tests }} USE_PGXS=1
working-directory: ptrack
shell: runuser dev {0}
- name: Collect coverage results
run: make coverage
working-directory: ptrack
shell: runuser dev {0}
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@v3
with:
working-directory: ptrack
runs-on: ubuntu-latest
48 changes: 0 additions & 48 deletions.travis.yml
View file
Open in desktop

This file was deleted.

25 changes: 0 additions & 25 deletionsDockerfile.in
View file
Open in desktop

This file was deleted.

62 changes: 60 additions & 2 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@

# contrib/ptrack/Makefile

MODULE_big = ptrack
Expand All@@ -15,13 +16,70 @@ TAP_TESTS = 1
# with Mkvcbuild.pm on PGv15+
PG_LIBS_INTERNAL += $(libpq_pgport)

ifdef USE_PGXS
PG_CONFIG ?= pg_config

ifdef USE_PGXS
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/ptrack
top_builddir = ../..
# Makefile.global is a build artifact and initially may not be available
ifneq ($(wildcard $(top_builddir)/src/Makefile.global), )
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
endif

# Assuming make is started in the ptrack directory
patch:
@cd $(top_builddir) && \
echo Applying the ptrack patch... && \
git apply --3way -v $(CURDIR)/patches/${PG_BRANCH}-ptrack-core.diff
ifeq ($(MODE), paranoia)
@echo Applying turn-off-hint-bits.diff for the paranoia mode... && \
git apply --3way -v $(CURDIR)/patches/turn-off-hint-bits.diff
endif

NPROC ?= $(shell nproc)
prefix := $(abspath $(top_builddir)/pgsql)
TEST_MODE ?= normal
# Postgres Makefile skips some targets depending on the MAKELEVEL variable so
# reset it when calling install targets as if they are started directly from the
# command line
install-postgres:
@cd $(top_builddir) && \
if [ "$(TEST_MODE)" = legacy ]; then \
./configure CFLAGS='-DEXEC_BACKEND' --disable-atomics --prefix=$(prefix) --enable-debug --enable-cassert --enable-depend --enable-tap-tests --quiet; \
else \
./configure --prefix=$(prefix) --enable-debug --enable-cassert --enable-depend --enable-tap-tests; \
fi && \
$(MAKE) -sj $(NPROC) install MAKELEVEL=0 && \
$(MAKE) -sj $(NPROC) -C contrib/ install MAKELEVEL=0

# Now when Postgres is built call all remainig targets with USE_PGXS=1

test-tap:
ifeq ($(TEST_MODE), legacy)
setarch x86_64 --addr-no-randomize $(MAKE) installcheck USE_PGXS=$(USE_PGXS) PG_CONFIG=$(PG_CONFIG)
else
$(MAKE) installcheck USE_PGXS=$(USE_PGXS) PG_CONFIG=$(PG_CONFIG)
endif

pg_probackup_dir = ../pg_probackup
# Pg_probackup's Makefile uses top_srcdir when building via PGXS so set it when calling this target
# At the moment building pg_probackup with multiple threads may run some jobs too early and end with an error so do not set the -j option
install-pg-probackup:
$(MAKE) -C $(pg_probackup_dir) install USE_PGXS=$(USE_PGXS) PG_CONFIG=$(PG_CONFIG) top_srcdir=$(top_srcdir)

test-python:
cd $(pg_probackup_dir); \
env="PG_PROBACKUP_PTRACK=ON PG_CONFIG=$(PG_CONFIG)"; \
if [ "$(TEST_MODE)" = normal ]; then \
env="$$env PG_PROBACKUP_TEST_BASIC=ON"; \
elif [ "$(TEST_MODE)" = paranoia ]; then \
env="$$env PG_PROBACKUP_PARANOIA=ON"; \
fi; \
env $$env python3 -m pytest -svv$(if $(shell python3 -m pytest --help | grep '\-n '), -n $(NPROC))$(if $(TESTS), -k '$(TESTS)') tests/ptrack_test.py

coverage:
gcov *.c *.h
Loading

[8]ページ先頭

©2009-2025 Movatter.jp