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
83 changes: 47 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
name: CI

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
branches:
- main

name: ci
on: [push, pull_request]
jobs:
build:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: tier0
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install uv
run: pip install uv

- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: uv pip install -e .[dev]

- name: Lint with ruff
run: source .venv/bin/activate && ruff check ./src

- name: Type check with mypy
run: source .venv/bin/activate && mypy ./src

- name: Test with pytest
run: source .venv/bin/activate && pytest
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- name: Run migrations
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/tier0
run: |
psql $DATABASE_URL -f db/migrations/001_init_trials_table.sql
- name: Run tests
run: |
source .venv/bin/activate
pytest -v tests/
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install ruff
run: pip install ruff
- name: Lint
run: ruff src/ tests/
63 changes: 63 additions & 0 deletions .github/workflows/playwright-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Testes de Sanidade com Playwright

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test-on-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Garantir permissão de execução do launcher
run: chmod +x ./agi-launcher-universal-v3.sh

- name: Iniciar app em background
run: |
./agi-launcher-universal-v3.sh --Debug &
sleep 10 # Tempo para inicialização do app

- name: Rodar testes Playwright
run: npx playwright test

test-on-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Iniciar app via launcher
run: |
.\agi-launcher-universal-v3.sh --Debug
sleep 10 # Tempo para inicialização do app

- name: Rodar testes Playwright
run: npx playwright test
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
70 changes: 70 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
# url: https://pypi.org/p/YOURPROJECT
#
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
# ALTERNATIVE: exactly, uncomment the following line instead:
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
115 changes: 115 additions & 0 deletions .github/workflows/release/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: 🚀 AGI Multiplatform Release

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: "Versão manual (ex: v0.91)"
required: false

permissions:
contents: write

env:
NODE_VERSION: 20
RELEASE_DIR: release

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
name: Build ${{ matrix.os }}
steps:
- name: 🧩 Checkout
uses: actions/checkout@v4

- name: ⚙️ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn

- name: 📦 Install dependencies
run: yarn install --frozen-lockfile

- name: 🏗️ Build AGI for ${{ matrix.os }}
run: |
mkdir -p $RELEASE_DIR
yarn build

- name: 📁 Upload artifacts
uses: actions/upload-artifact@v4
with:
name: agi-${{ matrix.os }}
path: ${{ env.RELEASE_DIR }}/

android:
runs-on: ubuntu-latest
name: Build Android (Bubblewrap)
steps:
- uses: actions/checkout@v4

- name: ⚙️ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 📦 Install Bubblewrap
run: npm i -g @bubblewrap/cli

- name: 📲 Build Android APK/AAB
run: |
mkdir -p $RELEASE_DIR
yarn build:android

- name: 📁 Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: agi-android
path: ${{ env.RELEASE_DIR }}/

release:
runs-on: ubuntu-latest
needs: [build, android]
name: 📤 Publish GitHub Release
steps:
- name: 🧩 Checkout
uses: actions/checkout@v4

- name: 📥 Download all artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.RELEASE_DIR }}

- name: 🧾 List release contents
run: ls -R $RELEASE_DIR

- name: 🏷️ Determine version
id: version
run: |
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT

- name: 🚀 Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "AGI ${{ steps.version.outputs.tag }}"
body: |
AGI Release ${{ steps.version.outputs.tag }}

**Includes:**
- Windows `.exe`
- Linux `.AppImage` `.deb` `.rpm`
- macOS `.app`
- Android `.apk` `.aab`

**Auto-generated by**: GitHub Actions 🚀
files: |
${{ env.RELEASE_DIR }}/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading