Set expiry properly to work with both memcached and diskcacke #680
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: CI | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| TEST_DB: hydra_base_test | |
| COV_MIN: 70 # Minimum acceptable coverage level | |
| TEST_AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| strategy: | |
| matrix: | |
| py_version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python ${{ matrix.py_version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.py_version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install --upgrade wheel | |
| pip install --upgrade pytest | |
| pip install --upgrade pytest-cov # Includes coverage | |
| pip install --upgrade pytest-order # Run test_login last | |
| - name: Setup MySQL | |
| run: | | |
| sudo systemctl start mysql | |
| mysql -e "create database $TEST_DB;" -uroot -proot | |
| mysql -e "show databases;" -uroot -proot | |
| - name: Setup MongoDB | |
| run: | | |
| sudo apt-get install gnupg curl | |
| curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor | |
| echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-org | |
| sudo systemctl daemon-reload | |
| sudo systemctl start mongod | |
| - name: Setup Memcache | |
| run: | | |
| sudo apt-get install -y memcached | |
| sudo apt-get install -y libmemcached-dev | |
| sudo systemctl start memcached | |
| - name: Install hydra-base | |
| run: | | |
| pip install -r requirements.txt | |
| pip install git+https://github.com/hydraplatform/hydra-client-python.git | |
| pip install git+https://github.com/hydraplatform/hydra-server.git | |
| pip install -e . | |
| - name: Run pytests | |
| run: pytest --db-backend=mysql --cov=hydra_base --cov-fail-under=$COV_MIN |