Atualizando versão base do fastapi #819
This file contains hidden or 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
| name: CI dos códigos de aulas | |
| on: | |
| push: | |
| paths: | |
| - 'codigo_das_aulas/**' | |
| - '.github/workflows/**' | |
| - 'tasks.py' | |
| pull_request: | |
| paths: | |
| - 'codigo_das_aulas/**' | |
| - '.github/workflows/**' | |
| - 'tasks.py' | |
| jobs: | |
| containers: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Checkout do código | |
| uses: actions/checkout@v4 | |
| - name: Instalar o Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Instalar Poetry | |
| run: pip install poetry | |
| - name: Instalar dependências do projeto | |
| run: poetry install --only dev | |
| - name: Rodar os dockers dos códigos de aulas | |
| run: poetry run invoke test-docker-build --python-version=${{ matrix.python-version }} | |
| windows-hell: | |
| runs-on: windows-latest | |
| env: | |
| PGHOST: localhost | |
| PGDATABASE: app_db | |
| PGUSERNAME: app_user | |
| PGPASSWORD: app_password | |
| DATABASE_URL: postgresql+psycopg://app_user:app_password@localhost:5432/app_db | |
| steps: | |
| - name: Add PostgreSQL binaries to PATH | |
| shell: bash | |
| run: echo "$PGBIN" >> $GITHUB_PATH | |
| - name: Start preinstalled PostgreSQL | |
| shell: bash | |
| run: | | |
| echo "Initializing database cluster..." | |
| # Convert backslashes to forward slashes in RUNNER_TEMP for Windows Git Bash | |
| export PGHOST="${RUNNER_TEMP//\\//}/postgres" | |
| export PGDATA="$PGHOST/pgdata" | |
| mkdir -p "$PGDATA" | |
| # initdb requires file for password in non-interactive mode | |
| export PWFILE="$RUNNER_TEMP/pwfile" | |
| echo "postgres" > "$PWFILE" | |
| initdb --pgdata="$PGDATA" --username="postgres" --pwfile="$PWFILE" | |
| echo "Starting PostgreSQL..." | |
| echo "unix_socket_directories = '$PGHOST'" >> "$PGDATA/postgresql.conf" | |
| pg_ctl start | |
| echo "Creating user..." | |
| psql --host "$PGHOST" --username="postgres" --dbname="postgres" --command="CREATE USER $PGUSERNAME PASSWORD '$PGPASSWORD'" --command="\du" | |
| echo "Creating database..." | |
| createdb --owner="$PGUSERNAME" --username="postgres" "$PGDATABASE" | |
| - name: Copia os arquivos do repo | |
| uses: actions/checkout@v5 | |
| - name: Instalar o python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Instalar Poetry | |
| run: pip install poetry | |
| - name: Instalar dependências globais | |
| run: poetry install --only dev | |
| - name: Roda os testes da ultima aula (win) | |
| run: poetry run invoke win-test-last-class | |
| - name: Roda as migrações (win) | |
| run: poetry run invoke win-test-migration | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Copia os arquivos do repo | |
| uses: actions/checkout@v5 | |
| - name: Atualização do sistema | |
| run: sudo apt update | |
| - name: instala o sqlite3 | |
| run: sudo apt install sqlite3 -y | |
| - name: Instalar o python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Instalar Poetry | |
| run: pip install poetry | |
| - name: Instalar dependências do projeto | |
| run: poetry install --only dev | |
| - name: Roda os testes dos códigos de aulas | |
| run: poetry run invoke test-sub | |
| checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Copia os arquivos do repo | |
| uses: actions/checkout@v5 | |
| - name: Instalar o python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Instalar Poetry | |
| run: pip install poetry | |
| - name: Instalar dependências do projeto | |
| run: poetry install --only dev | |
| - name: Roda os linters dos códigos de aulas | |
| run: poetry run invoke lint-sub | |
| - name: Roda os typos dos códigos de aulas | |
| run: poetry run invoke typos-sub | |
| - name: Testa as migrações | |
| run: poetry run invoke test-migrations |