Update Backend Config Files #1286
Workflow file for this run
This file contains hidden or 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: Pytest | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| pytest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.11'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt update | |
| sudo apt install -y postgresql | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -e . | |
| - name: Set up PostgreSQL database | |
| run: | | |
| sudo service postgresql start | |
| sudo -u postgres psql -c "CREATE USER ci_user WITH PASSWORD 'ci_password' SUPERUSER;" | |
| sudo -u postgres psql -c "CREATE DATABASE gs;" | |
| - name: Create CI .env file | |
| run: | | |
| cat > .env << EOF | |
| GS_DATABASE_USER=ci_user | |
| GS_DATABASE_PASSWORD=ci_password | |
| GS_DATABASE_LOCATION=localhost | |
| GS_DATABASE_PORT=5432 | |
| GS_DATABASE_NAME=gs | |
| EOF | |
| - name: Run Alembic migrations | |
| run: | | |
| alembic upgrade head | |
| - name: Create binary directory | |
| run: | | |
| mkdir build_gs | |
| cd build_gs | |
| cmake .. -DCMAKE_BUILD_TYPE=GS | |
| - name: Build | |
| run: | | |
| cd build_gs | |
| cmake --build . | |
| - name: Run pytest | |
| env: | |
| GS_DATABASE_USER: ci_user | |
| GS_DATABASE_PASSWORD: ci_password | |
| GS_DATABASE_LOCATION: localhost | |
| GS_DATABASE_PORT: 5432 | |
| GS_DATABASE_NAME: gs | |
| run: | | |
| python -m pytest |