Skip to content

Data retention for firestore #37

Data retention for firestore

Data retention for firestore #37

Workflow file for this run

name: Backend
on:
push:
branches: [ main ]
paths:
- backend/**
pull_request:
paths:
- backend/**
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: backend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements-cpu.txt
pip install -r requirements-dev.txt
- name: Lint
run: |
python -m ruff check .
- name: Test and coverage
run: |
python -m pytest --cov=. --cov-report term --cov-report xml:coverage.xml
env:
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_ACCESS: ${{ secrets.S3_ACCESS }}
S3_SECRET: ${{ secrets.S3_SECRET }}
S3_REGION: ${{ secrets.S3_REGION }}
FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }}
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: backend/coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
- run: cat ../code-coverage-results.md >> $GITHUB_STEP_SUMMARY
docker:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: backend
needs: test
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:backend"
push: true
tags: tymec/protopnet-api:latest
cache-from: type=registry,ref=tymec/protopnet-api:latest
cache-to: type=inline