Update python-app.yml #16
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
name: Pytest | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up environment | |
run: | | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-full python3-pip python3-venv ffmpeg | |
python3 -m venv /opt/venv | |
. /opt/venv/bin/activate | |
- name: Check Ubuntu and FFmpeg versions | |
run: | | |
cat /etc/os-release | |
ffmpeg -version | |
python3 --version | |
pip3 --version | |
- name: Install dependencies | |
run: | | |
. /opt/venv/bin/activate | |
pip3 install flake8 pytest | |
if [ -f requirements.txt ]; then pip3 install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
. /opt/venv/bin/activate | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
env: | |
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
run: | | |
. /opt/venv/bin |