Add client_encoding to connection string (#741) #2733
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
# Copyright 2020 Open Reaction Database Project Authors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: Tests | |
on: [ pull_request, push ] | |
jobs: | |
test_ord_schema: | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-14"] | |
python-version: ["3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
env: | |
PGDATA: $GITHUB_WORKSPACE/rdkit-postgres | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
miniconda-version: 'latest' | |
- name: Setup PostgreSQL | |
shell: bash -l {0} | |
run: | | |
# NOTE(skearnes): conda is only used for postgres (not python). | |
# NOTE(skearnes): rdkit-postgresql may not be available for ARM. | |
conda install -c rdkit rdkit-postgresql || conda install -c conda-forge postgresql | |
initdb | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install ord_schema | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel | |
python -m pip install .[tests] | |
- name: Run tests | |
shell: bash -l {0} | |
run: | | |
coverage erase | |
pytest -vv --cov=ord_schema --durations=20 | |
coverage xml | |
- uses: codecov/codecov-action@v1 | |
test_notebooks: | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-14"] | |
python-version: ["3.10", "3.11", "3.12"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install ord_schema | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel | |
python -m pip install .[examples,tests] | |
- name: Test notebooks | |
run: | | |
treon | |
test_proto_wrappers: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install protoc | |
run: | | |
mkdir protoc | |
cd protoc | |
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip | |
unzip protoc-22.3-linux-x86_64.zip | |
wget https://github.com/protocolbuffers/protobuf-javascript/releases/download/v3.21.2/protobuf-javascript-3.21.2-linux-x86_64.zip | |
unzip protobuf-javascript-3.21.2-linux-x86_64.zip | |
PATH=$GITHUB_WORKSPACE/protoc/bin:$PATH protoc --version | |
- name: Run protoc | |
run: | | |
PATH=$GITHUB_WORKSPACE/protoc/bin:$PATH ./compile_proto_wrappers.sh | |
./format.sh # Add license headers. | |
- name: Check for drift | |
run: | | |
# Ignore the copyright line in the diff so the year can change. | |
[[ -z $(git diff -I "^(#| \*) Copyright") ]] || { echo "proto wrappers do not match:\n$(git diff)"; exit 1; } | |
test_js: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Test NPM package | |
run: | | |
cd js/ord-schema | |
npm install-test | |
test_publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Test bump patch version | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
python -m pip install bump2version | |
bump2version patch --verbose | |
- name: Test python | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade build twine wheel | |
python -m build | |
- name: Test javascript | |
run: | | |
cd js/ord-schema | |
npm install | |
npm run build | |
npm publish --dry-run |