Nightly Tests #1
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: Nightly Tests | |
on: | |
schedule: | |
# Run every day at 2 AM UTC | |
- cron: '0 2 * * *' | |
workflow_dispatch: # Allow manual triggering | |
jobs: | |
test: | |
uses: ./.github/workflows/reusable-test.yml | |
with: | |
node-version: '20' | |
coverage-flags: 'nightly-tests' | |
coverage-name: 'codecov-nightly' | |
test-stats: | |
runs-on: ubuntu-latest | |
needs: test | |
if: always() | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Generate test statistics | |
run: npm run test:stats | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results-${{ github.run_number }} | |
path: | | |
coverage/ | |
test-results.xml | |
retention-days: 30 | |
security-scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Run security audit | |
run: npm audit --audit-level=moderate | |
- name: Check for outdated packages | |
run: npm outdated || true | |
performance-check: | |
uses: ./.github/workflows/reusable-build.yml | |
with: | |
node-version: '20' | |
upload-artifacts: false | |
bundle-analysis: | |
runs-on: ubuntu-latest | |
needs: performance-check | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build and measure performance | |
run: | | |
echo "Starting build performance test..." | |
time npm run build | |
echo "Build completed successfully" | |
- name: Check bundle size | |
run: | | |
if [ -d "dist" ]; then | |
echo "Bundle size analysis:" | |
du -sh dist/ | |
find dist -name "*.js" -exec du -sh {} \; | |
fi |