Merge pull request 'Fix CI test job naming to distinguish Node.js versions' (#23) from fix/ci-test-job-naming into main
Reviewed-on: deco/ice#23
This commit is contained in:
commit
87fef8309d
8 changed files with 124 additions and 118 deletions
121
.forgejo/workflows/auto-tag.yml
Normal file
121
.forgejo/workflows/auto-tag.yml
Normal file
|
@ -0,0 +1,121 @@
|
|||
name: Auto Tag Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
auto-tag:
|
||||
runs-on: self-hosted
|
||||
name: Create Auto Tag
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
run: |
|
||||
node --version
|
||||
npm --version
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Build project
|
||||
run: npm run build
|
||||
|
||||
- name: Generate version tag
|
||||
id: version
|
||||
run: |
|
||||
# Get the current date in YYYY.MM.DD format
|
||||
DATE_VERSION=$(date +%Y.%m.%d)
|
||||
|
||||
# Check if a tag with today's date already exists
|
||||
if git tag -l | grep -q "^v${DATE_VERSION}$"; then
|
||||
# If it exists, add a patch number
|
||||
PATCH_NUM=$(git tag -l "v${DATE_VERSION}.*" | wc -l)
|
||||
PATCH_NUM=$((PATCH_NUM + 1))
|
||||
VERSION="v${DATE_VERSION}.${PATCH_NUM}"
|
||||
else
|
||||
VERSION="v${DATE_VERSION}"
|
||||
fi
|
||||
|
||||
echo "Generated version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create and push tag
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
|
||||
# Configure git
|
||||
git config --local user.email "action@forgejo.org"
|
||||
git config --local user.name "Forgejo Action"
|
||||
|
||||
# Create annotated tag with commit info
|
||||
COMMIT_MSG=$(git log -1 --pretty=%B)
|
||||
git tag -a "$VERSION" -m "Release $VERSION
|
||||
|
||||
Latest changes:
|
||||
$COMMIT_MSG
|
||||
|
||||
Auto-generated on $(date)"
|
||||
|
||||
# Push the tag
|
||||
git push origin "$VERSION"
|
||||
|
||||
echo "✅ Created and pushed tag: $VERSION"
|
||||
|
||||
- name: Create release notes
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
|
||||
# Get the previous tag to generate changelog
|
||||
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
|
||||
|
||||
echo "# Release $VERSION" > RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo "**Release Date:** $(date '+%Y-%m-%d %H:%M:%S UTC')" >> RELEASE_NOTES.md
|
||||
echo "**Commit:** ${{ github.sha }}" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
|
||||
if [ -n "$PREV_TAG" ]; then
|
||||
echo "## Changes since $PREV_TAG" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
|
||||
# Get commits since last tag
|
||||
git log $PREV_TAG..HEAD --pretty=format:"- %s" >> RELEASE_NOTES.md
|
||||
else
|
||||
echo "## Latest Changes" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
git log -5 --pretty=format:"- %s" >> RELEASE_NOTES.md
|
||||
fi
|
||||
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo "## Installation" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo '```bash' >> RELEASE_NOTES.md
|
||||
echo "# Clone the repository" >> RELEASE_NOTES.md
|
||||
echo "git clone https://git.deco.sh/deco/ice.git" >> RELEASE_NOTES.md
|
||||
echo "cd ice" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo "# Checkout this release" >> RELEASE_NOTES.md
|
||||
echo "git checkout $VERSION" >> RELEASE_NOTES.md
|
||||
echo "" >> RELEASE_NOTES.md
|
||||
echo "# Install and build" >> RELEASE_NOTES.md
|
||||
echo "npm install" >> RELEASE_NOTES.md
|
||||
echo "npm run build" >> RELEASE_NOTES.md
|
||||
echo "npm start" >> RELEASE_NOTES.md
|
||||
echo '```' >> RELEASE_NOTES.md
|
||||
|
||||
echo "Release notes created:"
|
||||
cat RELEASE_NOTES.md
|
|
@ -51,7 +51,7 @@ jobs:
|
|||
|
||||
test:
|
||||
runs-on: self-hosted
|
||||
name: Run Tests
|
||||
name: Run Tests (Node ${{ matrix.node-version }})
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -94,7 +94,7 @@ jobs:
|
|||
- name: Upload coverage reports
|
||||
uses: https://code.forgejo.org/forgejo/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-report
|
||||
name: coverage-report.zip
|
||||
path: coverage/
|
||||
|
||||
build:
|
||||
|
|
|
@ -1,110 +0,0 @@
|
|||
name: PR Labeler
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize]
|
||||
|
||||
jobs:
|
||||
label:
|
||||
runs-on: self-hosted
|
||||
name: Label Pull Request
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Analyze and label PR
|
||||
run: |
|
||||
echo "Analyzing PR for automatic labeling..."
|
||||
|
||||
# Get changed files
|
||||
git fetch origin main
|
||||
# Try different approaches to get the diff
|
||||
if git merge-base origin/main HEAD >/dev/null 2>&1; then
|
||||
CHANGED_FILES=$(git diff --name-only origin/main...HEAD)
|
||||
else
|
||||
# Fallback: compare with origin/main directly
|
||||
CHANGED_FILES=$(git diff --name-only origin/main HEAD || echo "")
|
||||
fi
|
||||
|
||||
if [ -z "$CHANGED_FILES" ]; then
|
||||
echo "Unable to determine changed files, using all files in current branch"
|
||||
CHANGED_FILES=$(find . -name "*.ts" -o -name "*.js" -o -name "*.scss" -o -name "*.json" | grep -v node_modules | head -20)
|
||||
fi
|
||||
|
||||
# Initialize labels array
|
||||
LABELS=""
|
||||
|
||||
# Check file types and paths
|
||||
if echo "$CHANGED_FILES" | grep -q "^src/.*\.ts$"; then
|
||||
LABELS="$LABELS,backend"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^src/frontend/.*\.ts$"; then
|
||||
LABELS="$LABELS,frontend"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^public/.*\.\(js\|html\)$"; then
|
||||
LABELS="$LABELS,frontend"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^src/scss/.*\.scss$"; then
|
||||
LABELS="$LABELS,styles"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^tests/.*\.test\.ts$"; then
|
||||
LABELS="$LABELS,tests"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^\.forgejo/workflows/"; then
|
||||
LABELS="$LABELS,ci/cd"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "package.*\.json$"; then
|
||||
LABELS="$LABELS,dependencies"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^docs/\|README\.md\|CLAUDE\.md"; then
|
||||
LABELS="$LABELS,documentation"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^src/i18n/"; then
|
||||
LABELS="$LABELS,i18n"
|
||||
fi
|
||||
|
||||
if echo "$CHANGED_FILES" | grep -q "^scripts/"; then
|
||||
LABELS="$LABELS,tooling"
|
||||
fi
|
||||
|
||||
# Check PR title/body for keywords
|
||||
PR_TITLE="${{ github.event.pull_request.title }}"
|
||||
PR_BODY="${{ github.event.pull_request.body }}"
|
||||
|
||||
if echo "$PR_TITLE $PR_BODY" | grep -qi "security\|vulnerability\|CVE"; then
|
||||
LABELS="$LABELS,security"
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE $PR_BODY" | grep -qi "performance\|optimize\|speed"; then
|
||||
LABELS="$LABELS,performance"
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE $PR_BODY" | grep -qi "bug\|fix\|issue"; then
|
||||
LABELS="$LABELS,bug"
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE $PR_BODY" | grep -qi "feature\|enhancement\|add"; then
|
||||
LABELS="$LABELS,enhancement"
|
||||
fi
|
||||
|
||||
if echo "$PR_TITLE $PR_BODY" | grep -qi "breaking change\|BREAKING"; then
|
||||
LABELS="$LABELS,breaking-change"
|
||||
fi
|
||||
|
||||
# Remove leading comma and duplicates
|
||||
LABELS=$(echo "$LABELS" | sed 's/^,//' | tr ',' '\n' | sort -u | tr '\n' ',' | sed 's/,$//')
|
||||
|
||||
echo "Suggested labels: $LABELS"
|
||||
|
||||
# Note: In actual Forgejo/Gitea, you would use the API to apply labels
|
||||
# This is just for demonstration
|
||||
echo "To apply labels, use: tea pr edit ${{ github.event.pull_request.number }} --add-label \"$LABELS\""
|
|
@ -188,7 +188,6 @@
|
|||
</footer>
|
||||
|
||||
<!-- Load shared theme utility -->
|
||||
<script src="theme-utils.js"></script>
|
||||
<script src="utils.js"></script>
|
||||
<script src="admin.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -9,7 +9,6 @@ class I18nService {
|
|||
this.defaultLocale = 'en';
|
||||
this.availableLocales = ['en', 'es-MX'];
|
||||
this.currentLocale = this.getStoredLocale() || this.detectBrowserLocale();
|
||||
this.loadTranslations();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -173,8 +173,6 @@ placeholder="Enter address, intersection (e.g., Main St & Second St, City), or l
|
|||
</div>
|
||||
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<!-- Load shared theme utility -->
|
||||
<script src="theme-utils.js"></script>
|
||||
<script src="utils.js"></script>
|
||||
<script src="app-mapbox.js"></script>
|
||||
|
||||
|
|
|
@ -139,7 +139,6 @@
|
|||
</footer>
|
||||
|
||||
<!-- Load shared theme utility -->
|
||||
<script src="theme-utils.js"></script>
|
||||
<script>
|
||||
// Initialize theme when page loads
|
||||
document.addEventListener('DOMContentLoaded', initializeTheme);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Service Worker for Great Lakes Ice Report PWA
|
||||
const CACHE_NAME = 'ice-report-v1';
|
||||
const CACHE_NAME = 'ice-report-v2';
|
||||
const OFFLINE_URL = '/offline.html';
|
||||
|
||||
// Files to cache for offline functionality
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue