Skip to content
Open
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
105 changes: 105 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '19 7 * * 4'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: csharp
build-mode: none
- language: javascript-typescript
build-mode: none
- language: ruby
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
100 changes: 100 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
Got it — you’re aiming to set up a GitHub Actions workflow (or Codespaces dev environment) that can build an Android app targeting SDK 36 from your AI server repo, with speed and configurability in mind. Let’s break this down into a practical setup:

---

⚙️ Key Steps for Workflow Setup

1. Define Your Environment
- Base image: Use a Codespace dev container or GitHub Actions runner with Android SDK preinstalled.
- SDK 36: Ensure the workflow installs Android SDK 36 (via sdkmanager).
- Gradle: Use Gradle wrapper (./gradlew) for consistent builds.

2. GitHub Actions Workflow (CI/CD)
Here’s a sample .github/workflows/android.yml:

`yaml
name: Android Build

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

jobs:
build:
runs-on: ubuntu-latest

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

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Install Android SDK
run: |
sudo apt-get update
sudo apt-get install -y wget tar unzip
yes | sdkmanager --licenses
sdkmanager "platforms;android-36" "build-tools;34.0.0"

- name: Build with Gradle
run: ./gradlew assembleDebug
`

✅ This workflow:
- Checks out your repo
- Installs Java & Android SDK 36
- Builds the app with Gradle

---

3. Codespaces Dev Container
For fast iteration, add a .devcontainer/devcontainer.json:

`json
{
"name": "Android SDK 36 Dev",
"image": "mcr.microsoft.com/devcontainers/java:17",
"features": {
"android": "latest"
},
"postCreateCommand": "sdkmanager 'platforms;android-36' 'build-tools;34.0.0'"
}
`

This ensures your Codespace spins up with Android SDK 36 ready to go.

---

4. Configurable AI Server Manager
- Add environment variables in workflow (env:) for server endpoints, API keys, or build flavors.
- Example:
`yaml
env:
AISERVERURL: ${{ secrets.AISERVERURL }}
BUILD_VARIANT: debug
`
- Use Gradle buildConfigField to inject these into your app.

---

5. Speed Optimizations
- Enable Gradle caching in GitHub Actions:
`yaml
- name: Cache Gradle
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('/.gradle') }}
`
- Use parallel builds (org.gradle.parallel=true in gradle.properties).
- Pre-install dependencies in Codespaces dev container.

---

👉 Next step: Do you want me to extend this into a full CI/CD pipeline (including testing, linting, and publishing APKs), or keep it lightweight just for building and configuring the AI server manager?
34 changes: 34 additions & 0 deletions .github/workflows/summary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Summarize new issues

on:
issues:
types: [opened]

jobs:
summary:
runs-on: ubuntu-latest
permissions:
issues: write
models: read
contents: read

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

- name: Run AI inference
id: inference
uses: actions/ai-inference@v1
with:
prompt: |
Summarize the following GitHub issue in one paragraph:
Title: ${{ github.event.issue.title }}
Body: ${{ github.event.issue.body }}

- name: Comment with AI summary
run: |
gh issue comment $ISSUE_NUMBER --body '${{ steps.inference.outputs.response }}'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
RESPONSE: ${{ steps.inference.outputs.response }}