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
15 changes: 8 additions & 7 deletions .github/workflows/java.yml → .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@ name: Java CI with Coverage

on:
push:
# Run on pushes to any branch, but only when relevant paths change
paths:
branches: [ master ]
paths:
- 'algorithms-java/**'
- '.github/workflows/java.yml'
- '.github/workflows/ci-java.yml'
pull_request:
# Only run for PRs targeting master
branches: [ master ]
paths:
- 'algorithms-java/**'
- '.github/workflows/java.yml'
- '.github/workflows/ci-java.yml'

jobs:
test:
runs-on: ubuntu-latest
env:
IS_MASTER: ${{ github.ref == 'refs/heads/master' }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -45,7 +46,7 @@ jobs:
./gradlew clean test jacocoTestReport

- name: Publish coverage to Coveralls
if: github.ref == 'refs/heads/master'
if: env.IS_MASTER == 'true'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -55,7 +56,7 @@ jobs:
flag-name: java

- name: Upload coverage reports to Codecov (backup)
if: github.ref == 'refs/heads/master'
if: env.IS_MASTER == 'true'
uses: codecov/codecov-action@v4
with:
file: algorithms-java/build/reports/jacoco/test/jacocoTestReport.xml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
name: JavaScript CI with Pages

on:
pull_request:
push:
branches: [ master ]
paths:
- 'algorithms-js/**'
- '.github/workflows/deploy-pages.yml'
- '.github/workflows/ci-js-pages.yml'
pull_request:
branches: [ master ]
paths:
- 'algorithms-js/**'
- '.github/workflows/ci-js-pages.yml'

env:
IS_MASTER: ${{ github.ref == 'refs/heads/master' }}

jobs:
build:
Expand Down Expand Up @@ -34,6 +41,7 @@ jobs:
npm run build

- name: Upload artifact
if: env.IS_MASTER == 'true'
uses: actions/upload-pages-artifact@v3
with:
path: algorithms-js
Expand All @@ -43,6 +51,8 @@ jobs:
needs: build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
env:
IS_MASTER: ${{ github.ref == 'refs/heads/master' }}
permissions:
contents: read
pages: write
Expand All @@ -52,7 +62,9 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
if: env.IS_MASTER == 'true'
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
if: env.IS_MASTER == 'true'
id: deployment
uses: actions/deploy-pages@v4
89 changes: 89 additions & 0 deletions .github/workflows/ci-soft-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Soft Review

on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
soft-review:
name: Soft Review Feedback
runs-on: ubuntu-latest
steps:
- name: Generate soft review and comment on PR
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const owner = context.repo.owner;
const repo = context.repo.repo;
const number = pr.number;

// Fetch changed files in the PR
const files = await github.paginate(github.rest.pulls.listFiles, {
owner,
repo,
pull_number: number,
per_page: 100
});

let todoFindings = [];
let largeFiles = [];
let summaryLines = [];

for (const f of files) {
const filename = f.filename;
// Skip workflow files to avoid reviewing our own CI YAML
if (filename.startsWith('.github/workflows/')) {
continue;
}
const additions = f.additions;
const changes = f.changes;
const patch = f.patch || '';

// Detect TODO/FIXME in added lines only
const addedLines = patch.split('\n').filter(l => l.startsWith('+'));
const hasTodo = addedLines.some(l => /\b(TODO|FIXME|HACK|XXX)\b/i.test(l));
if (hasTodo) {
todoFindings.push(`- ${filename}`);
}

// Flag large file changes (heuristic: > 500 additions or > 1500 total changes)
if (additions > 500 || changes > 1500) {
largeFiles.push(`- ${filename} (additions: ${additions}, changes: ${changes})`);
}
}

summaryLines.push(`PR Title: ${pr.title}`);
summaryLines.push(`Author: @${pr.user.login}`);
summaryLines.push('');

if (todoFindings.length > 0) {
summaryLines.push('Noticed TODO/FIXME markers in:');
summaryLines.push(...todoFindings);
summaryLines.push('');
}

if (largeFiles.length > 0) {
summaryLines.push('Large file changes detected:');
summaryLines.push(...largeFiles);
summaryLines.push('');
}

if (todoFindings.length === 0 && largeFiles.length === 0) {
summaryLines.push('No TODO/FIXME markers or large changes detected.');
}

summaryLines.push('');
summaryLines.push('This is an automated soft review (no blocking).');

const body = summaryLines.join('\n');

await github.rest.issues.createComment({
owner,
repo,
issue_number: number,
body
});
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
![Open Issues](https://img.shields.io/github/issues/sachinlala/SimplifyLearning?label=Issues&color=006400&style=flat)
[![Forks](https://img.shields.io/github/forks/sachinlala/SimplifyLearning.svg?color=darkgreen)](https://github.com/sachinlala/SimplifyLearning/network/members)
[![Stars](https://img.shields.io/github/stars/sachinlala/SimplifyLearning.svg)](https://github.com/sachinlala/SimplifyLearning/stargazers)
[![Java CI with Coverage](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-java.yml/badge.svg?branch=master)](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-java.yml)
[![JavaScript CI with Pages](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-js-pages.yml/badge.svg?branch=master)](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-js-pages.yml)

### <img src="https://raw.githubusercontent.com/sachinlala/SimplifyLearning/master/algorithms-js/assets/images/sl-logo.svg" width="20" height="20" alt="SL" style="vertical-align: sub; margin-right: 6px;"> Simplify Learning

> **An anthology of foundational algorithms and data structures.**
**An anthology of foundational algorithms and data structures.**

> ✨ Featuring interactive visualizations and examples to minimize cognitive load and maximize learning.
✨ Featuring interactive visualizations and examples to minimize cognitive load and maximize learning.

[![Live Demo](https://img.shields.io/badge/Live%20Demo-4A90E2?style=for-the-badge)](https://sachinlala.github.io/SimplifyLearning/algorithms-js/)

Expand Down
1 change: 1 addition & 0 deletions algorithms-java/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Java](https://img.shields.io/badge/Java-21-darkgreen.svg)](https://openjdk.org/)
[![Coverage](https://img.shields.io/badge/Coverage-95%25-darkgreen.svg)](https://coveralls.io/github/sachinlala/SimplifyLearning?branch=master)
[![Java CI with Coverage](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-java.yml/badge.svg?branch=master)](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-java.yml)

> Comprehensive Java implementations of algorithms with rigorous testing and high code coverage.

Expand Down
1 change: 1 addition & 0 deletions algorithms-js/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![JavaScript](https://img.shields.io/badge/JavaScript-ES6+-yellow.svg)](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[![Mobile Friendly](https://img.shields.io/badge/Mobile-Friendly-blue.svg)]()
[![JavaScript CI with Pages](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-js-pages.yml/badge.svg?branch=master)](https://github.com/sachinlala/SimplifyLearning/actions/workflows/ci-js-pages.yml)

> An interactive collection of algorithms with visual explanations and hands-on examples written in plain JavaScript.

Expand Down