Skip to content
Draft
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
136 changes: 136 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Continuous Integration

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

permissions:
contents: read
security-events: write
pull-requests: read

jobs:
code-quality:
name: Code Quality & Security
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: 'trivy-results.sarif'

dependency-review:
name: Dependency Review
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
pull-requests: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Dependency Review
uses: actions/dependency-review-action@v4

build-test:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Agda
run: |
sudo apt-get update
sudo apt-get install -y agda
continue-on-error: true

- name: Check Agda installation
run: agda --version
continue-on-error: true

- name: Build Agda files
run: |
if compgen -G "*.agda" > /dev/null || compgen -G "src/*.agda" > /dev/null; then
echo "Building Agda files..."
find . -name "*.agda" -type f -exec agda {} \;
else
echo "No Agda files found to build"
fi
continue-on-error: true

documentation:
name: Documentation Check
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check README exists
run: |
if [ ! -f README.md ]; then
echo "README.md is missing"
exit 1
fi

- name: Validate markdown files
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: '**/*.md'
continue-on-error: true

notify-success:
name: Notify Related Repositories
runs-on: ubuntu-latest
needs: [code-quality, build-test, documentation]
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read

steps:
- name: Trigger AI-Time-Machines workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: lippytm/AI-Time-Machines
event-type: web3ai-updated
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "repository": "${{ github.repository }}"}'
continue-on-error: true

- name: Trigger Time-Machines-Builders workflow
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: lippytm/Time-Machines-Builders-
event-type: web3ai-updated
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "repository": "${{ github.repository }}"}'
continue-on-error: true
104 changes: 104 additions & 0 deletions .github/workflows/cross-repo-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Cross-Repository Sync

on:
workflow_dispatch:
inputs:
target_repository:
description: 'Target repository to sync with (e.g., AI-Time-Machines)'
required: true
type: choice
options:
- AI-Time-Machines
- Time-Machines-Builders-
- gatsby-starter-blog
- Transparency-Logic-Time-Machine-Bots-
sync_type:
description: 'Type of synchronization'
required: true
type: choice
options:
- workflow-config
- documentation
- github-config
- all

permissions:
contents: read

jobs:
sync-repositories:
name: Sync with ${{ github.event.inputs.target_repository }}
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout Web3AI
uses: actions/checkout@v4
with:
path: web3ai

- name: Checkout target repository
uses: actions/checkout@v4
with:
repository: lippytm/${{ github.event.inputs.target_repository }}
token: ${{ secrets.REPO_ACCESS_TOKEN }}
path: target
continue-on-error: true

- name: Sync workflow configurations
if: github.event.inputs.sync_type == 'workflow-config' || github.event.inputs.sync_type == 'all'
run: |
echo "Syncing workflow configurations..."
cd target
if [ -d ".github/workflows" ]; then
echo "## Workflow Comparison" > ../workflow-comparison.md
echo "" >> ../workflow-comparison.md

# List workflows in both repositories
echo "### Web3AI Workflows" >> ../workflow-comparison.md
ls -1 ../web3ai/.github/workflows/*.yml 2>/dev/null | xargs -n1 basename >> ../workflow-comparison.md || echo "None" >> ../workflow-comparison.md
echo "" >> ../workflow-comparison.md

echo "### Target Repository Workflows" >> ../workflow-comparison.md
ls -1 .github/workflows/*.yml 2>/dev/null | xargs -n1 basename >> ../workflow-comparison.md || echo "None" >> ../workflow-comparison.md
echo "" >> ../workflow-comparison.md

echo "### Recommendation" >> ../workflow-comparison.md
echo "Review workflow files manually and identify opportunities for standardization." >> ../workflow-comparison.md
else
echo "Target repository does not have workflows directory" > ../workflow-comparison.md
fi
continue-on-error: true

- name: Sync documentation
if: github.event.inputs.sync_type == 'documentation' || github.event.inputs.sync_type == 'all'
run: |
echo "Checking documentation consistency..."
# Compare README patterns, contributing guidelines, etc.
if [ -f "target/README.md" ] && [ -f "web3ai/README.md" ]; then
echo "Both repositories have README files"
fi
continue-on-error: true

- name: Sync GitHub configurations
if: github.event.inputs.sync_type == 'github-config' || github.event.inputs.sync_type == 'all'
run: |
echo "Syncing GitHub configurations..."
# Sync issue templates, PR templates, etc.
continue-on-error: true

- name: Create summary
run: |
echo "## Sync Summary" > sync-summary.md
echo "- Source: Web3AI" >> sync-summary.md
echo "- Target: ${{ github.event.inputs.target_repository }}" >> sync-summary.md
echo "- Sync Type: ${{ github.event.inputs.sync_type }}" >> sync-summary.md
echo "- Timestamp: $(date)" >> sync-summary.md
cat sync-summary.md

- name: Upload sync summary
uses: actions/upload-artifact@v4
with:
name: sync-summary
path: sync-summary.md
73 changes: 73 additions & 0 deletions .github/workflows/dependency-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Dependency Updates

on:
schedule:
- cron: '0 0 * * 1' # Weekly on Mondays
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update-dependencies:
name: Update Dependencies
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for package manager
id: check_pm
run: |
if [ -f "package.json" ]; then
echo "pm=npm" >> $GITHUB_OUTPUT
elif [ -f "Cargo.toml" ]; then
echo "pm=cargo" >> $GITHUB_OUTPUT
else
echo "pm=none" >> $GITHUB_OUTPUT
fi

- name: Setup Node.js
if: steps.check_pm.outputs.pm == 'npm'
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Update npm dependencies
if: steps.check_pm.outputs.pm == 'npm'
run: |
npm update
npm audit fix --audit-level=moderate
continue-on-error: true

- name: Update Agda libraries
run: |
echo "Checking for Agda library updates..."
# Agda libraries are typically managed differently
# This is a placeholder for future implementation
continue-on-error: true

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update dependencies'
title: 'chore: update dependencies'
body: |
This PR updates the project dependencies to their latest versions.

- Updated dependencies to latest compatible versions
- Applied security fixes where available

Please review the changes and test thoroughly before merging.
branch: dependency-updates
delete-branch: true
labels: dependencies, automated
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release

on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write

jobs:
release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Agda
run: |
sudo apt-get update
sudo apt-get install -y agda
continue-on-error: true

- name: Build project
run: |
if compgen -G "*.agda" > /dev/null || compgen -G "src/*.agda" > /dev/null; then
echo "Building Agda files..."
find . -name "*.agda" -type f -exec agda {} \;
else
echo "No Agda files found to build"
fi
continue-on-error: true

- name: Generate changelog
id: changelog
run: |
echo "## Changes" > CHANGELOG.md
if git describe --tags --abbrev=0 HEAD^ 2>/dev/null; then
git log $(git describe --tags --abbrev=0 HEAD^)..HEAD --pretty=format:"- %s" >> CHANGELOG.md
else
git log --pretty=format:"- %s" >> CHANGELOG.md
fi

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: CHANGELOG.md
draft: false
prerelease: false

- name: Notify related repositories
run: |
echo "Release created successfully"
continue-on-error: true
Loading