DEV Community

Ihor Kalnytskyi
Ihor Kalnytskyi

Posted on • Originally published at kalnytskyi.com on

Setup PostgreSQL for Linux, Windows and macOS using GitHub Actions

GitHub Actions is a CI/CD platform that is widely used among open-source software hosted on GitHub. If you happened to host your software there, you may end up needing a SQL server to test your application. PostgreSQL is the most common choice nowadays.

As of today (Nov 24, 2021), there's only one action on the marketplace to setup a PostgreSQL server for Linux, Windows and macOS action runners. If you among those who want to test their software on all major platforms, you have no option but to use ikalnytskyi/action-setup-postgres. Below is the typical usage example:

steps:
  - name: Setup PostgreSQL
    uses: ikalnytskyi/action-setup-postgres@v1
    id: postgres

  - name: Run tests
    env:
      CONNECTION_URI: ${{ steps.postgres.outputs.connection-uri }}
    run: pytest -vv tests/
Enter fullscreen mode Exit fullscreen mode

So why use that exact action and no other?

  • Runs on Linux, macOS and Windows action runners.
  • Fast! Preinstalled binaries are used.
  • Easy to audit, just 4 steps YAML!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay