X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.github%2Fworkflows%2Frun-tests.yaml;h=4777a9fb4945dcf5e8c5d2f0f4949a8e6bfbd4b5;hb=bc282b1800583b7eac6b46a56aad38138a3f0a84;hp=aae7413f97d3d4b35eb7fa73a8abe1aaa937fc29;hpb=6c4efb7843209db6963d5d41d979df37f52c01b8;p=sqlconvert.git diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index aae7413..4777a9f 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] include: - os: ubuntu-latest os-name: Linux @@ -35,9 +35,14 @@ jobs: # Setup Python/pip - uses: actions/checkout@v2 + - uses: s-weigand/setup-conda@v1 + with: + python-version: ${{ matrix.python-version }} + if: ${{ runner.os == 'Linux' && matrix.python-version != '3.11' }} - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + if: ${{ runner.os != 'Linux' || matrix.python-version == '3.11' }} - name: Cache pip uses: actions/cache@v3 with: @@ -54,6 +59,7 @@ jobs: - name: Set TOXENV run: | import os, sys + ld_library_path = None pyver = '%d%d' % tuple(sys.version_info[:2]) toxenv = 'py%s' % pyver toxenv += ',py%s-sqlite' % pyver @@ -61,10 +67,15 @@ jobs: toxenv += '-w32' toxenv += ',py%s-postgres' % pyver if os.name == 'posix': + if pyver == '27': # Python 2.7 on Linux requires `$LD_LIBRARY_PATH` + ld_library_path = os.path.join( + os.path.dirname(os.path.dirname(sys.executable)), 'lib') toxenv += ',py%s-flake8' % pyver elif os.name == 'nt': toxenv += '-w32' with open(os.environ['GITHUB_ENV'], 'a') as f: + if ld_library_path: + f.write('LD_LIBRARY_PATH=' + ld_library_path + '\n') f.write('TOXENV=' + toxenv + '\n') f.write('PGPASSWORD=test\n') shell: python