diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 410c6f2..5b2e7fb 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,6 +9,7 @@ on: jobs: validate-and-build: # Synology NAS act_runner: host-based 실행 (Docker 불필요) + # Python: /usr/bin/python3 (3.8.12), Node.js: /usr/local/bin/node (v18.18.2) runs-on: self-hosted steps: @@ -23,25 +24,33 @@ jobs: git fetch origin ${{ github.sha }} --depth=1 git reset --hard FETCH_HEAD - - name: Install Python Dependencies - env: - SETUPTOOLS_USE_DISTUTILS: stdlib + - name: Configure Runtime Paths run: | - if ! python3 -m pip --version >/dev/null 2>&1; then - curl -sS https://bootstrap.pypa.io/pip/3.8/get-pip.py -o get-pip.py - python3 get-pip.py --user --quiet - rm get-pip.py + # Node.js 18은 /usr/local/bin에 설치됨 (appstore) — PATH에 추가 + echo "/usr/local/bin" >> $GITHUB_PATH + echo "=== 런타임 버전 확인 ===" + /usr/bin/python3 --version + /usr/local/bin/node --version + /usr/local/bin/npm --version + + - name: Setup Python Environment + run: | + VENV=/volume1/gitea/python_venv + if [ ! -f "$VENV/bin/pip" ]; then + echo "=== 최초 1회 venv 생성 및 패키지 설치 ===" + /usr/bin/python3 -m venv "$VENV" + "$VENV/bin/pip" install --upgrade pip --quiet + "$VENV/bin/pip" install "numpy==1.24.4" "pandas==2.0.3" \ + yfinance pyyaml openpyxl --quiet --prefer-binary + if [ -f requirements.txt ]; then + "$VENV/bin/pip" install -r requirements.txt --quiet --prefer-binary + fi + echo "venv 설치 완료" + else + echo "=== venv 재사용: $("$VENV/bin/python" --version 2>&1) ===" fi - export PATH=$HOME/.local/bin:$PATH - python3 -c "import platform, sys; print('[ENV_DEBUG] Platform:', platform.platform(), 'Python:', sys.version)" - python3 -m pip install --upgrade pip --user --quiet - python3 -m pip install --upgrade --force-reinstall "setuptools==59.6.0" "wheel" "Cython<3.0" --user --quiet - python3 -c "import setuptools; print('[ENV_DEBUG] installed setuptools:', setuptools.__version__)" - python3 -m pip install "numpy==1.24.4" --user --quiet --no-build-isolation - python3 -m pip install "pandas==2.0.3" --user --quiet --no-build-isolation - if [ -f requirements.txt ]; then python3 -m pip install -r requirements.txt --user --quiet --prefer-binary; fi - python3 -m pip install yfinance pyyaml openpyxl --user --quiet --prefer-binary - echo "$HOME/.local/bin" >> $GITHUB_PATH + # 이후 모든 스텝에서 venv python 사용 + echo "$VENV/bin" >> $GITHUB_PATH - name: Install Node Dependencies run: npm install --quiet