diff --git a/.github/workflows/bundle-ci.yml b/.github/workflows/bundle-ci.yml new file mode 100644 index 00000000..87b64f04 --- /dev/null +++ b/.github/workflows/bundle-ci.yml @@ -0,0 +1,52 @@ +name: Quicklisp bundle build & regression test + +# Runs when anything that affects the v3 bundle changes: the bundle +# machinery itself, the Makefile (which holds BUNDLEDIST), or the Lisp +# source that gets compiled into the bundle binary. +on: + pull_request: + paths: + - 'Makefile' + - 'bundle/**' + - 'src/**' + - '.github/workflows/bundle-ci.yml' + push: + branches: [main] + paths: + - 'Makefile' + - 'bundle/**' + - 'src/**' + - '.github/workflows/bundle-ci.yml' + +jobs: + bundle: + name: Build and test from Quicklisp bundle + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@v5 + + - name: Install postgresql-common + run: sudo apt-get install -y postgresql-common + + - name: Install pgapt repository + run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y + + - name: Install build dependencies + run: sudo apt-get build-dep -y . + + - name: Build Quicklisp bundle + # Downloads the pinned Quicklisp dist (BUNDLEDIST in Makefile), + # creates the self-contained bundle tarball, extracts it, compiles + # pgloader from the bundled sources, and smoke-tests with --version. + run: make bundle + + - name: Run regression suite against bundle binary + # pg_virtualenv spins up a throwaway PostgreSQL cluster whose + # superuser is the current OS user (not 'postgres'). Pass that + # name via PGSUPERUSER so the test Makefile's createdb/psql calls + # use the right role — mirroring what debian/tests/testsuite does. + run: | + pg_virtualenv -i'-Atrust' \ + env PGSUPERUSER="$(id -un)" make test-bundle diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index dd80f6cd..ffe5e9b1 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -3,14 +3,21 @@ name: Smoke test — published JAR # Runs whenever the v4-dev pre-release is updated (i.e. after every green CI # push that publishes a new JAR), and can also be triggered manually. on: - release: - types: [prereleased] + # Fires automatically after the integration-tests workflow publishes a new + # JAR to the v4-dev pre-release on main. Using workflow_run rather than + # release: prereleased because updating assets on an existing pre-release + # does not re-fire the release event. + workflow_run: + workflows: ["pgloader v4 Integration Tests"] + types: [completed] + branches: [main] workflow_dispatch: jobs: smoke: name: Download JAR & migrate Chinook SQLite → PostgreSQL runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} services: postgres: diff --git a/Makefile b/Makefile index 7fcc4140..ead2bfd4 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ QLDIR = $(BUILDDIR)/quicklisp MANIFEST = $(BUILDDIR)/manifest.ql LATEST = $(BUILDDIR)/pgloader-latest.tgz -BUNDLEDIST = 2022-02-20 +BUNDLEDIST = 2026-01-01 BUNDLENAME = pgloader-bundle-$(VERSION) BUNDLEDIR = $(BUILDDIR)/bundle/$(BUNDLENAME) BUNDLE = $(BUILDDIR)/$(BUNDLENAME).tgz @@ -199,7 +199,7 @@ $(BUNDLE): $(BUNDLEDIR) $(BUNDLEDIR)/version.sexp cp bundle/README.md $(BUNDLEDIR) cp bundle/save.lisp $(BUNDLEDIR) sed -e s/%VERSION%/$(VERSION)/ < bundle/Makefile > $(BUNDLEDIR)/Makefile - git archive --format=tar --prefix=pgloader-$(VERSION)/ main \ + git archive --format=tar --prefix=pgloader-$(VERSION)/ HEAD \ | tar -C $(BUNDLEDIR)/local-projects/ -xf - make QLDIR=$(BUNDLEDIR) clones tar -C build/bundle \ diff --git a/bundle/Makefile b/bundle/Makefile index 630c5549..11edbea3 100644 --- a/bundle/Makefile +++ b/bundle/Makefile @@ -62,7 +62,7 @@ $(PGLOADER): $(BUILDAPP) mv $@.tmp $@ test: $(PGLOADER) - $(MAKE) PGLOADER=$(realpath $(PGLOADER)) -C $(SRCDIR)/test regress + $(MAKE) PGLOADER=$(realpath $(PGLOADER)) -C $(SRCDIR)/test prepare regress save: sbcl --no-userinit --load ./save.lisp diff --git a/debian/rules b/debian/rules index 5c4d8934..37c6bda1 100755 --- a/debian/rules +++ b/debian/rules @@ -74,11 +74,10 @@ override_dh_strip override_dh_dwz: override_dh_installman-arch: mkdir -p debian/pgloader/usr/share/man/man1/ - PATH=$(CURDIR)/debian/pgloader/usr/bin:$(PATH) \ help2man --version-string $(DEB_VERSION_UPSTREAM) \ --no-info \ --name "extract, transform and load data into PostgreSQL" \ - pgloader > \ + $(CURDIR)/debian/pgloader/usr/bin/pgloader > \ debian/pgloader/usr/share/man/man1/pgloader.1 override_dh_gencontrol: