name: 'Setup enviPy Environment' description: 'Shared setup for enviPy CI - installs dependencies and prepares environment' inputs: skip-frontend: description: 'Skip frontend build steps (pnpm, tailwind)' required: false default: 'false' skip-playwright: description: 'Skip Playwright installation' required: false default: 'false' ssh-private-key: description: 'SSH private key for git access' required: true run-migrations: description: 'Run Django migrations after setup' required: false default: 'true' runs: using: "composite" steps: - name: Install system tools via apt shell: bash run: | sudo apt-get update sudo apt-get install -y postgresql-client openjdk-11-jre-headless - name: Setup ssh shell: bash run: | mkdir -p ~/.ssh echo "${{ inputs.ssh-private-key }}" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-keyscan git.envipath.com >> ~/.ssh/known_hosts eval $(ssh-agent -s) ssh-add ~/.ssh/id_ed25519 - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10 - name: Use Node.js uses: actions/setup-node@v4 with: node-version: 20 cache: "pnpm" - name: Install uv uses: astral-sh/setup-uv@v6 with: enable-cache: true - name: Setup Python venv shell: bash run: | uv sync --locked --all-extras --dev - name: Install Playwright if: inputs.skip-playwright == 'false' shell: bash run: | source .venv/bin/activate playwright install --with-deps - name: Build Frontend if: inputs.skip-frontend == 'false' shell: bash run: | uv run python scripts/pnpm_wrapper.py install cat << 'EOF' > pnpm-workspace.yaml onlyBuiltDependencies: - '@parcel/watcher' - '@tailwindcss/oxide' EOF uv run python scripts/pnpm_wrapper.py run build - name: Wait for Postgres shell: bash run: | until pg_isready -h postgres -U ${{ env.POSTGRES_USER }}; do echo "Waiting for postgres..." sleep 2 done echo "Postgres is ready!" - name: Run Django Migrations if: inputs.run-migrations == 'true' shell: bash run: | source .venv/bin/activate python manage.py migrate --noinput