Skip to content

Commit

Permalink
Fix GHA config (#35)
Browse files Browse the repository at this point in the history
* Bump Python and Postgres versions for Ubuntu image
* Bump minimum python version to 3.7
  • Loading branch information
danielhollas authored Jul 12, 2023
1 parent 7b3319f commit 5d7d158
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 44 deletions.
69 changes: 32 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- name: Install python dependencies
run: |
Expand All @@ -33,14 +33,15 @@ jobs:
timeout-minutes: 5

strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.9]
python-version: [3.8, 3.11]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -64,36 +65,36 @@ jobs:

- name: Upload coverage report
if: github.repository == 'aiidateam/pgsu'
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: ubuntu-apt
file: ./coverage.xml
fail_ci_if_error: true

ubuntu-apt-1804:
ubuntu-apt-2004:
# ubuntu using postgresql installed via apt (+ pgtest)
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
timeout-minutes: 5

strategy:
matrix:
python-version: [3.6]
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install postgresql-10
sudo cat /etc/postgresql/10/main/pg_hba.conf
sudo pg_ctlcluster 10 main start
sudo apt install postgresql
sudo cat /etc/postgresql/??/main/pg_hba.conf
sudo pg_ctlcluster 12 main start
- name: Install pgsu
run: |
Expand All @@ -107,7 +108,7 @@ jobs:

- name: Upload coverage report
if: github.repository == 'aiidateam/pgsu'
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: ubuntu-apt
file: ./coverage.xml
Expand All @@ -116,7 +117,7 @@ jobs:
ubuntu-postgres-action:
# ubuntu using postgres docker container (custom action)

runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
timeout-minutes: 5

strategy:
Expand All @@ -125,7 +126,7 @@ jobs:
postgres-pw: ["testpw"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: CasperWA/postgresql-action@v1.2
with:
postgresql version: '10'
Expand All @@ -135,7 +136,7 @@ jobs:
#postgresql auth: trust

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -151,7 +152,7 @@ jobs:

- name: Upload coverage report
if: github.repository == 'aiidateam/pgsu'
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: ubuntu-apt
file: ./coverage.xml
Expand All @@ -160,7 +161,7 @@ jobs:
ubuntu-postgres-service:
# ubuntu using postgres docker container (service provided by github actions)

runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 5

strategy:
Expand All @@ -181,9 +182,9 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -200,7 +201,7 @@ jobs:

- name: Upload coverage report
if: github.repository == 'aiidateam/pgsu'
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: ubuntu-postgres-service
file: ./coverage.xml
Expand All @@ -218,10 +219,10 @@ jobs:
# python-version: [3.8]
#
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v3
#
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v1
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
Expand Down Expand Up @@ -253,13 +254,13 @@ jobs:
strategy:
matrix:
python-version: [3.8]
os: ['macos-12', 'windows-2019']
os: ['macos-12', 'windows-2022']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -274,12 +275,6 @@ jobs:
initdb -D test_db
pg_ctl -D test_db -o "-d 5" start # start with debugging
# - name: Create postgres superuser on Windows
# if: matrix.os == 'windows-2019'
# shell: bash -l {0}
# run: |
# createuser -U runneradmin -s postgres

- name: Install pgsu
run: |
pip install -e .[testing]
Expand All @@ -290,7 +285,7 @@ jobs:

- name: Upload coverage report
if: github.repository == 'aiidateam/pgsu'
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
name: "${{ matrix.os }}-conda"
file: ./coverage.xml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.10

- name: Upgrade setuptools and install package
run: |
Expand Down
2 changes: 1 addition & 1 deletion pgsu/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@click.command()
@click.argument('query', type=str, default=GET_DBS_COMMAND)
def run(query):
"""Execute SQL command as PostrgreSQL superuser."""
"""Execute SQL command as PostgreSQL superuser."""
pgsu = PGSU(interactive=True, quiet=False)
click.echo(f'Executing query: {query}')
dbs = pgsu.execute(query)
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython

[options]
packages = find:
install_requires =
click
psycopg2-binary>=2.8.3
python_requires = ~=3.6
python_requires = ~=3.7

[options.packages.find]
exclude =
Expand Down

0 comments on commit 5d7d158

Please sign in to comment.