Skip to content

[ST-687] apps/offlineevent: Delete deprecated Offline Events #9512

[ST-687] apps/offlineevent: Delete deprecated Offline Events

[ST-687] apps/offlineevent: Delete deprecated Offline Events #9512

Workflow file for this run

name: Django CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
build:
runs-on: ubuntu-24.04
# Use your self-built image as container for the entire job
container: ghcr.io/${{ github.repository }}/ci-base:latest
steps:
- uses: actions/checkout@v4
- name: Start PostgreSQL and Redis
run: |
sudo service postgresql start
sudo service redis-server start
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Cache node packages
uses: actions/cache@v4
env:
cache-name: cache-node-packages
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
- name: Cache uv packages
uses: actions/cache@v4
env:
cache-name: cache-uv-packages
with:
path: ~/.cache/uv
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/requirements/dev.txt') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache testmon data
id: cache-testmon
uses: actions/cache@v4
with:
path: .testmondata
key: ${{ runner.os }}-testmon-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/requirements/dev.txt', 'meinberlin/config/settings/travis.py', 'meinberlin/config/settings/test.py', 'pytest.ini') }}
restore-keys: |
${{ runner.os }}-testmon-${{ steps.setup-python.outputs.python-version }}-
- name: Checks
run: |
echo "node_modules cache hit: ${{ steps.cache-node-modules.outputs.cache-hit }}"
ls -la node_modules 2>/dev/null || echo "node_modules directory does not exist"
echo "testmon cache hit: ${{ steps.cache-testmon.outputs.cache-hit }}"
ls -la .testmondata || true
./scripts/a4-check.sh
- name: Install Python Dependencies
run: |
uv pip install -r requirements/dev.txt --system
uv pip install coveralls --system
- name: Install NPM Dependencies
run: |
if [ "${{ steps.cache-node-modules.outputs.cache-hit }}" != "true" ]; then
echo "node_modules cache miss - running npm ci"
npm ci --prefer-offline --no-audit --no-fund
else
echo "node_modules cache hit - skipping npm ci"
fi
- name: Build NPM
run: |
npm run build
- name: Run Tests
env:
PGPASSWORD: postgres
PGHOSTADDR: 127.0.0.1
run: |
python manage.py collectstatic > /dev/null
mkdir -p media
isort --diff -c meinberlin tests
python manage.py makemigrations --dry-run --check --noinput
python manage.py clear_cache
flake8 meinberlin tests --exclude migrations,settings
if [ "${{ github.event_name }}" = "push" ]; then
py.test --ds=meinberlin.config.settings.travis --cov
elif [ "${{ github.event_name }}" = "pull_request" ]; then
py.test --ds=meinberlin.config.settings.travis --testmon --cov
fi
- name: Coveralls
env:
COVERALLS_SERVICE_NAME: github-actions
GITHUB_TOKEN: ${{ secrets.COV }}
run: |
git config --global --add safe.directory /__w/a4-meinberlin/a4-meinberlin
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
coveralls
- name: Run Frontend Tests
run: |
npm test
npm run lint
- name: Deploy dev
if: github.ref == 'refs/heads/dev'
env:
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }}
PROJECT_BUILD: 'meinberlin-design'
VERSION_BUILD: 'dev'
run: |
./scripts/deploy.sh $PROJECT_BUILD ${VERSION_BUILD##*/}
- name: Deploy main
if: github.ref == 'refs/heads/main'
env:
TRAVIS_SSH_SECRET: ${{ secrets.DEPLOY }}
run: |
./scripts/deploy.sh