Remove CI for jenkins #5
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: Run Tests | |
| on: | |
| pull_request: | |
| branches: [ "*" ] | |
| push: | |
| branches: [ main, dev ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.11] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Set up environment variables | |
| run: | | |
| echo "PORT=8000" >> $GITHUB_ENV | |
| echo "FRONTEND_URL=http://localhost:3000" >> $GITHUB_ENV | |
| echo "TOKEN_LIFETIME_SECOND=3600" >> $GITHUB_ENV | |
| echo "DATABASE_NAME=test_db.sqlite3" >> $GITHUB_ENV | |
| echo "DATABASE_USER=test_user" >> $GITHUB_ENV | |
| echo "DATABASE_PASSWORD=test_password" >> $GITHUB_ENV | |
| echo "DATABASE_HOST=localhost" >> $GITHUB_ENV | |
| echo "DATABASE_PORT=5432" >> $GITHUB_ENV | |
| echo "SECRET_KEY=test-secret-key-for-github-actions" >> $GITHUB_ENV | |
| echo "DEBUG=True" >> $GITHUB_ENV | |
| - name: Run tests | |
| run: | | |
| python run_all_tests.py --verbose | |
| - name: Run tests with coverage | |
| run: | | |
| pip install coverage | |
| python run_all_tests.py --coverage --verbose | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v3 | |
| if: matrix.python-version == '3.11' | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false |