Address reviewer comments #393
Workflow file for this run
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: Data Registry CI | |
on: | |
- push | |
- pull_request | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
# Service containers to run with `runner-job` | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: desc_data_registry | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
# Our strategy lists the OS and Python versions we want to test on. | |
strategy: | |
# Don't quit all jobs if only one job fails. | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
# Our CI steps for this job. | |
steps: | |
# Check out this repository code. | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# Install Python. | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Install our package. | |
- name: Install dataregistry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
python -m pip install pytest | |
# Make a dummy config file. | |
- name: Create dummy config file | |
run: | | |
echo "sqlalchemy.url : postgresql://postgres:postgres@localhost:5432/desc_data_registry" > $HOME/.config_reg_access | |
# Create schema | |
- name: Create data registry default schema | |
run: | | |
python scripts/create_registry_db.py --config $HOME/.config_reg_access | |
# Run CI tests | |
- name: Run CI tests | |
run: | | |
pytest -v -s tests/unit_tests | |
end-to-end-tests: | |
runs-on: ubuntu-latest | |
env: | |
DATAREG_CONFIG: "${{ github.workspace }}/config.txt" | |
# Service containers to run with `runner-job` | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgres | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: desc_data_registry | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
# Our strategy lists the OS and Python versions we want to test on. | |
strategy: | |
# Don't quit all jobs if only one job fails. | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
# Our CI steps for this job. | |
steps: | |
# Check out this repository code. | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# Install Python. | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Install our package. | |
- name: Install dataregistry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
python -m pip install pytest | |
# Make a dummy config file. | |
- name: Create dummy config file | |
run: | | |
echo "sqlalchemy.url : postgresql://postgres:postgres@localhost:5432/desc_data_registry" > $DATAREG_CONFIG | |
# Create schema | |
- name: Create data registry default and production schema | |
run: | | |
python scripts/create_registry_db.py --config $DATAREG_CONFIG | |
python scripts/create_registry_db.py --config $DATAREG_CONFIG --schema production | |
# Run CI tests | |
- name: Run CI tests | |
run: | | |
cd tests/end_to_end_tests | |
# Register database entries using dataregistry package | |
python create_test_entries.py | |
# Register more database entries using the CLI | |
bash create_test_entries_cli.sh | |
# Run some test queries | |
pytest -v test_query.py | |
sqlite-end-to-end-tests: | |
runs-on: ubuntu-latest | |
env: | |
DATAREG_CONFIG: "${{ github.workspace }}/config.txt" | |
# Our strategy lists the OS and Python versions we want to test on. | |
strategy: | |
# Don't quit all jobs if only one job fails. | |
fail-fast: false | |
matrix: | |
python-version: ["3.9"] | |
# Our CI steps for this job. | |
steps: | |
# Check out this repository code. | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# Install Python. | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Install our package. | |
- name: Install dataregistry | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install . | |
python -m pip install pytest | |
# Make a dummy config file. | |
- name: Create dummy config file | |
run: | | |
echo "sqlalchemy.url : sqlite:///${HOME}/registry.db" > $DATAREG_CONFIG | |
# Create schema | |
- name: Create data registry default schema | |
run: | | |
python scripts/create_registry_db.py --config $DATAREG_CONFIG | |
# Run CI tests | |
- name: Run CI tests | |
run: | | |
cd tests/end_to_end_tests | |
# Register database entries using dataregistry package | |
python create_test_entries.py | |
# Register more database entries using the CLI | |
bash create_test_entries_cli.sh | |
# Run some test queries | |
pytest -v test_query.py |