Bump google-* #199
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: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.10'] | |
postgresql-version: ['10', '11', '12', '13', '14', '15'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Install PostgreSQL manually | |
run: | | |
sudo apt-get remove --purge postgresql* | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main 15" | sudo tee -a /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 | |
sudo apt-get -y install postgresql-${{ matrix.postgresql-version }} postgresql-server-dev-${{ matrix.postgresql-version }} | |
- name: Install Linux dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes python3-setuptools python${{ matrix.python-version }}-dev make gcc | |
- name: Clone and compile Multicorn | |
run: | | |
git clone https://github.com/pgsql-io/multicorn2.git /opt/Multicorn | |
cd /opt/Multicorn | |
sudo mkdir -p /usr/share/doc/postgresql-doc-${{ matrix.postgresql-version }} /usr/lib/postgresql/${{ matrix.postgresql-version }}/lib/bitcode/ | |
sudo chmod 777 /usr/share/doc/postgresql-doc-${{ matrix.postgresql-version }} /usr/lib/postgresql/${{ matrix.postgresql-version }}/lib/ /usr/share/postgresql/${{ matrix.postgresql-version }}/extension/ /usr/lib/postgresql/${{ matrix.postgresql-version }}/lib/bitcode/ | |
sudo chmod 777 `python${{ matrix.python-version }} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` | |
make && make install | |
env: | |
PYTHON_OVERRIDE: python${{ matrix.python-version }} | |
- name: Start PostgreSQL | |
run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
- name: Display PostgreSQL version | |
run: psql --version | |
- name: Decrypt BigQuery key | |
run: | | |
mkdir /opt/key/ | |
gpg --quiet --batch --yes --decrypt --passphrase="${{ secrets.GPG_PASSPHRASE_BIGQUERY_KEY }}" --output /opt/key/key.json src/unittest/utils/key/key.json.gpg | |
- name: Install Python dependencies | |
run: | | |
pip install -U pip | |
pip install pycodestyle coverage pytest pypandoc | |
python setup.py install | |
- name: Display Python dependencies | |
run: | | |
pip3 freeze | |
- name: Run pycodestyle | |
run: | | |
pycodestyle --exclude=venv --ignore=E501 . | |
- name: Run pytest | |
run: | | |
coverage run --source=. -m pytest | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: "/opt/key/key.json" | |
- name: Generate coverage report | |
run: | | |
coverage report -m | |
- name: Upload coverage reports to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${CODECOV_TOKEN} |