Create main.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/python_java.yml | |
name: Python y Java Workflow | |
on: [push, pull_request] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clonar el repositorio | |
uses: actions/checkout@v3 | |
# --- Configuración de Java --- | |
- name: Configurar Java JDK | |
uses: actions/setup-java@v4.4.0 | |
with: | |
java-version: '21' # Cambiar si necesitas otra versión | |
distribution: 'temurin' # Ejemplo: temurin, zulu, adopt | |
cache: 'maven' # Cachea dependencias de Maven | |
cache-dependency-path: '**/pom.xml' # O build.gradle, si usas Gradle | |
- name: Verificar instalación de Java | |
run: java -version | |
# --- Configuración de Python --- | |
- name: Configurar Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12.6' # Especifica la versión de Python | |
- name: Instalar dependencias de Python | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Ejecutar pruebas en Python | |
run: python tests/test_python.py # Cambia la ruta según tu repo | |
# --- Ejecutar Java --- | |
- name: Compilar y ejecutar Java | |
run: | | |
javac src/Main.java -d out | |
java -cp out Main |