Github工作流失败时的PGSQL转储



我在Github工作流上运行测试,这些测试使用PostgreSQL数据库作为服务。

如果测试套件失败,我想制作一个pg转储作为构建的工件。

问题很简单:考虑到PostgreSQL是一项服务,如何在GithubActions中调用pgdump。

这并没有那么复杂。我添加了pg_dump的安装(在测试失败时使用(和工件操作:
steps:
-   name: Install pg_dump
run: sudo apt-get install postgresql-client
-   name: Run tests
run: make test
env:
DATABASE_URL: postgres://username:password@localhost:5432/database_name
-   uses: actions/upload-artifact@v2
with:
name: my-artifact
path: var/test-artifact/

最新更新