Skip to content

OPAL-550 (Save config file, and use it during create_pantry) #1034

OPAL-550 (Save config file, and use it during create_pantry)

OPAL-550 (Save config file, and use it during create_pantry) #1034

Workflow file for this run

# This workflow will install Python dependencies, and run tests.
name: Weave CI/CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
pytest-linux:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# POSTGRES_DB: jupyterhub
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install minio
run: |
wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20230518000536.0.0_amd64.deb -O minio.deb
sudo dpkg -i minio.deb
- name: Launch minio
continue-on-error: true
run: |
mkdir ~/minio
minio server ~/minio --console-address :9090 &!
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.8.0
with:
mongodb-version: 6.0.5
mongodb-username: testusername
mongodb-password: testpassword
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install .[extras]
- name: Test with pytest
run: |
export WEAVE_SQL_HOST=localhost
export WEAVE_SQL_USERNAME=postgres
export WEAVE_SQL_PASSWORD=postgres
export WEAVE_SQL_DB_NAME=postgres
export WEAVE_SQL_PORT=5432
export MONGODB_HOST=localhost
export MONGODB_USERNAME=testusername
export MONGODB_PASSWORD=testpassword
export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
export S3_ENDPOINT=http://172.17.0.1:9000/
pytest -vv weave/tests/
env:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
pytest-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install .
- name: Test with pytest
run: |
pytest -vv weave/tests/
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
with:
version: 0.4.10
args: --extend-select=E
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pylint
run: python3.10 -m pip install pylint
- name: Install Weave and Dependencies
run: |
python3.10 -m pip install .[extras]
python3.10 -m pip install pytest
# If you do not install Weave's dependencies then it will fail PyLint due to import-errors
- name: Run pylint
run: pylint weave weave/tests/
version_check:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: actions/checkout@v3
with:
ref: 'main'
- name: Main Version
run: echo "MAIN_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Merge Version
run: echo "MERGE_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
- name: Version Comparison
run: python .github/workflows/verify_version.py ${MAIN_VERSION} ${MERGE_VERSION}