Handle multiple recovery sites #1252
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build pghoard | |
| # Default to read-only access to all APIs. | |
| permissions: read-all | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '**' | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| # only use one version for the lint step | |
| python-version: ["3.10"] | |
| steps: | |
| - id: checkout-code | |
| uses: actions/checkout@v3 | |
| with: | |
| # Do not persist the token during execution of this job. | |
| persist-credentials: false | |
| - id: prepare-python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - id: dependencies | |
| run: | | |
| pip install . | |
| pip install ".[dev]" | |
| - id: pylint | |
| run: make lint | |
| - id: mypy | |
| run: make mypy | |
| - id: validate-style | |
| run: | | |
| make fmt | |
| if [ $(git diff --name-only --diff-filter=ACMR | wc -l ) != 0 ]; then | |
| echo "Reformatting failed! Please run make fmt on your commits and resubmit!" 1>&2; | |
| git diff; | |
| exit 1; | |
| fi | |
| test: | |
| runs-on: ubuntu-22.04 | |
| needs: lint | |
| strategy: | |
| max-parallel: 5 | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - id: checkout-code | |
| uses: actions/checkout@v3 | |
| - id: prepare-python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - id: dependencies | |
| run: | | |
| # Remove preinstalled Postgres because this will conflict with the version we actually want. | |
| sudo apt-get remove -u postgresql\* | |
| # Get the postgresql gpg key | |
| sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7FCC7D46ACCC4CF8 | |
| # Setup the Postgres repositories | |
| sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main 18" > /etc/apt/sources.list.d/pgdg.list' | |
| sudo apt-get update | |
| # Setup build deps | |
| sudo apt-get install -y libsnappy-dev postgresql-13 postgresql-14 postgresql-15 postgresql-16 postgresql-17 postgresql-18 | |
| # Setup common python dependencies | |
| python -m pip install --upgrade pip | |
| pip install . | |
| pip install ".[constraints]" | |
| pip install -e . | |
| - id: unittest | |
| run: make coverage | |
| - id: upload-codecov | |
| # Third-party action pinned to v3.1.1 | |
| uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 | |
| with: | |
| verbose: true |