Apply Development History to Master #37
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: DP-REX pytests | |
on: | |
pull_request: | |
branches: ["trunk"] | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install poetry | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
- name: Install redis | |
run: | | |
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg | |
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list | |
sudo apt-get update | |
sudo apt-get -y install redis | |
- name: Setup Python # Set Python version | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'poetry' | |
cache-dependency-path: | | |
pyproject.toml | |
poetry.lock | |
# workaround for 3.8 | |
- name: Install dependencies | |
run: | | |
poetry env use ${{ matrix.python-version }} | |
poetry install --no-interaction | |
- name: Test with pytest | |
run: | | |
if [[ ${{ matrix.python-version }} == '3.9' ]]; then | |
VRAN_REDIS_PORT=6309 poetry run pytest --cov-report html:coverage-${{ matrix.python-version }} | |
fi | |
if [[ ${{ matrix.python-version }} == '3.10' ]]; then | |
VRAN_REDIS_PORT=6310 poetry run pytest --cov-report html:coverage-${{ matrix.python-version }} | |
fi | |
if [[ ${{ matrix.python-version }} == '3.11' ]]; then | |
VRAN_REDIS_PORT=6311 poetry run pytest --cov-report html:coverage-${{ matrix.python-version }} | |
fi | |
env: | |
VRAN_CI: "True" | |
VRAN_DB_NAME: ${{ secrets.VRAN_DB_NAME }} | |
VRAN_DB_USER: ${{ secrets.VRAN_DB_USER }} | |
VRAN_DB_PASSWORD: ${{ secrets.VRAN_DB_PASSWORD }} | |
VRAN_PG_CONF: ${{ secrets.VRAN_PG_CONF}} | |
VRAN_PG_SERVICE_FILE: ${{ secrets.VRAN_PG_SERVICE_FILE }} | |
VRAN_DJANGO_KEY: ${{ secrets.VRAN_DJANGO_KEY }} | |
VRAN_REDIS_PASSWORD: "" | |
VRAN_REDIS_CONF: "" | |
- name: Upload pytest test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pytest-results-${{ matrix.python-version }} | |
path: coverage-${{ matrix.python-version }} | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} | |
frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: "ui" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: "ui/package-lock.json" | |
- name: Install frontend dependencies | |
run: npm ci | |
- name: Lint frontend | |
run: npm run lint | |
- name: test frontend | |
run: npm run test |