Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
contents: read
packages: write
security-events: write
actions: write

steps:
# 1. Checkout code
Expand Down Expand Up @@ -53,15 +54,46 @@ jobs:
restore-keys: |
${{ runner.os }}-sbt-

# 5. Build (compile & stage)
# 5. Clean old caches (keep only 15 most recent)
- name: Clean old caches
# if: github.ref == 'refs/heads/main'
uses: actions/github-script@v7
with:
script: |
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
sort: 'created_at',
direction: 'desc'
});

const cachesToDelete = caches.data.actions_caches.slice(15);

if (cachesToDelete.length === 0) {
console.log('No old caches to delete.');
return;
}

console.log(`Found ${cachesToDelete.length} cache(s) to delete.`);
for (const cache of cachesToDelete) {
console.log(`Deleting cache: ${cache.key} (ID: ${cache.id})`);
await github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id
});
}

# 6. Build (compile & stage)
- name: Build Play Framework App
run: sbt stage

# 6. Run Scalastyle (Static Code Analysis)
# 7. Run Scalastyle (Static Code Analysis)
- name: Run Scalastyle
run: sbt scalastyle

# 7. Run tests with coverage
# 8. Run tests with coverage
- name: Run Scoverage Tests
run: sbt clean coverage test coverageReport coverageAggregate

Expand Down
38 changes: 35 additions & 3 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
contents: read
packages: write
security-events: write
actions: write

steps:
# 1. Checkout & Setup
Expand All @@ -33,7 +34,38 @@ jobs:
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

# 2. Install dependencies
# 2. Clean old caches (keep only 15 most recent)
- name: Clean old caches
# if: github.ref == 'refs/heads/main'
uses: actions/github-script@v7
with:
script: |
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
per_page: 100,
sort: 'created_at',
direction: 'desc'
});

const cachesToDelete = caches.data.actions_caches.slice(15);

if (cachesToDelete.length === 0) {
console.log('No old caches to delete.');
return;
}

console.log(`Found ${cachesToDelete.length} cache(s) to delete.`);
for (const cache of cachesToDelete) {
console.log(`Deleting cache: ${cache.key} (ID: ${cache.id})`);
await github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id
});
}

# 3. Install dependencies
- name: Install dependencies
run: npm ci

Expand All @@ -44,13 +76,13 @@ jobs:
npm run format:check || true
npx tsc --noEmit || true

# 4. Run Tests
# 5. Run Tests
- name: Run Unit Tests & Coverage
run: |
npm run test:run
npm run test:coverage

# 5. Build & Deploy
# 6. Build & Deploy
- name: Build & Deploy
run: |
npm run build
Expand Down