Skip to content

deps(deps): bump node-cron from 3.0.3 to 4.2.1 #735

deps(deps): bump node-cron from 3.0.3 to 4.2.1

deps(deps): bump node-cron from 3.0.3 to 4.2.1 #735

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: npm
- name: Verify package-lock.json exists
run: |
if [ ! -f package-lock.json ]; then
echo "⚠️ package-lock.json not found, generating it..."
npm install --package-lock-only
else
echo "✅ package-lock.json found"
fi
- name: Install dependencies
run: npm ci
- name: Run database migrations
run: npm run migrate:up
continue-on-error: true
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
- name: Run linter
run: npm run lint
continue-on-error: true
- name: Run tests with coverage
run: npm run test:coverage
continue-on-error: true
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
REDIS_URL: redis://localhost:6379
NODE_ENV: test
- name: Run Playwright e2e tests
run: |
npx playwright install --with-deps
npm run build
npm run start &
APP_PID=$!
sleep 3
npm run test:e2e:ci
kill $APP_PID
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
REDIS_URL: redis://localhost:6379
NODE_ENV: test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
cache: npm
- name: Verify package-lock.json exists
run: |
if [ ! -f package-lock.json ]; then
echo "⚠️ package-lock.json not found, generating it..."
npm install --package-lock-only
else
echo "✅ package-lock.json found"
fi
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
continue-on-error: true
- name: Check build artifacts
run: ls -la dist/
continue-on-error: true
# Docker build job - optional, only runs if secrets are configured
# To enable: Add REGISTRY_USERNAME and REGISTRY_PASSWORD to repository secrets
docker:
runs-on: ubuntu-latest
needs: [test, build]
# Skip if secrets are not configured
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Check if registry credentials are configured
id: check_secrets
run: |
if [ -n "${{ secrets.REGISTRY_USERNAME }}" ] && [ -n "${{ secrets.REGISTRY_PASSWORD }}" ]; then
echo "credentials_available=true" >> $GITHUB_OUTPUT
else
echo "credentials_available=false" >> $GITHUB_OUTPUT
echo "⚠️ Docker registry credentials not configured. Skipping Docker build."
echo "To enable Docker builds, add REGISTRY_USERNAME and REGISTRY_PASSWORD secrets."
fi
- name: Log in to Container Registry
if: steps.check_secrets.outputs.credentials_available == 'true'
uses: docker/login-action@v4
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
if: steps.check_secrets.outputs.credentials_available == 'true'
id: docker_build
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ github.repository }}:${{ github.sha }}
${{ github.repository }}:${{ github.ref_name }}
${{ github.ref_name == 'main' && format('{0}:latest', github.repository) || '' }}
- name: Log image location and tags
if: steps.check_secrets.outputs.credentials_available == 'true'
run: |
echo "=== Docker Image Build Complete ==="
echo "Image Location: ${{ github.repository }}"
echo "Image Digest: ${{ steps.docker_build.outputs.digest }}"
echo "Assigned Tags:"
echo " - ${{ github.repository }}:${{ github.sha }}"
echo " - ${{ github.repository }}:${{ github.ref_name }}"
if [ "${{ github.ref_name }}" == "main" ]; then
echo " - ${{ github.repository }}:latest"
fi
echo "=================================="