Valid the input path from header 'x-pghoard-target-path' #902
Workflow file for this run
This file contains 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.9] | |
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 -r requirements.txt | |
pip install -r requirements.dev.txt -c constraints.txt | |
- 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.8", "3.9", "3.10", "3.11"] | |
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: | | |
# Setup the Postgres repositories | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main 14" > /etc/apt/sources.list.d/pgdg.list' | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo apt-get update | |
# Setup build deps | |
sudo apt-get install -y libsnappy-dev postgresql-10 postgresql-11 postgresql-12 postgresql-13 postgresql-14 postgresql-15 postgresql-16 | |
# Setup common python dependencies | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements.dev.txt -c constraints.txt | |
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 |