Update debugging step in CI workflow to list all files with human-readable sizes
All checks were successful
CI / ci (push) Successful in 6s
All checks were successful
CI / ci (push) Successful in 6s
This commit is contained in:
parent
1d49e9c3f9
commit
dd2805b7f0
4 changed files with 12 additions and 39 deletions
12
.github/copilot-instructions.md
vendored
12
.github/copilot-instructions.md
vendored
|
|
@ -14,7 +14,7 @@ ANewDawn is a Discord bot written in Python 3.13+ using the discord.py library a
|
||||||
|
|
||||||
- **Python**: 3.13 or higher required
|
- **Python**: 3.13 or higher required
|
||||||
- **Package Manager**: Use `uv` for dependency management (see `pyproject.toml`)
|
- **Package Manager**: Use `uv` for dependency management (see `pyproject.toml`)
|
||||||
- **Docker**: The project uses Docker for deployment (see `Dockerfile` and `docker-compose.yml`)
|
- **Deployment**: The project is designed to run as a systemd service (see `systemd/anewdawn.service`)
|
||||||
- **Environment Variables**: Copy `.env.example` to `.env` and fill in required tokens
|
- **Environment Variables**: Copy `.env.example` to `.env` and fill in required tokens
|
||||||
|
|
||||||
## Code Style and Conventions
|
## Code Style and Conventions
|
||||||
|
|
@ -57,7 +57,7 @@ ruff format --check --verbose
|
||||||
|
|
||||||
- `main.py` - Main bot application with all commands and event handlers
|
- `main.py` - Main bot application with all commands and event handlers
|
||||||
- `pyproject.toml` - Project configuration and dependencies
|
- `pyproject.toml` - Project configuration and dependencies
|
||||||
- `Dockerfile` / `docker-compose.yml` - Container configuration
|
- `systemd/` - systemd unit and environment templates
|
||||||
- `.github/workflows/` - CI/CD workflows
|
- `.github/workflows/` - CI/CD workflows
|
||||||
|
|
||||||
## Key Components
|
## Key Components
|
||||||
|
|
@ -82,10 +82,10 @@ The main bot client is `LoviBotClient` which extends `discord.Client`. It handle
|
||||||
|
|
||||||
## CI/CD
|
## CI/CD
|
||||||
|
|
||||||
The GitHub Actions workflow (`.github/workflows/docker-publish.yml`) runs:
|
The GitHub Actions workflow (`.github/workflows/ci.yml`) runs:
|
||||||
1. Ruff linting and format check
|
1. Dependency install via `uv sync`
|
||||||
2. Dockerfile validation
|
2. Ruff linting and format check
|
||||||
3. Docker image build and push to GitHub Container Registry
|
3. Unit tests via `pytest`
|
||||||
|
|
||||||
## Common Tasks
|
## Common Tasks
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,12 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Print the local dir and list files for debugging
|
||||||
|
run: |
|
||||||
|
echo "Current directory: $(pwd)"
|
||||||
|
echo "Files in current directory:"
|
||||||
|
ls -ahl
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: uv sync --all-extras --dev -U
|
run: uv sync --all-extras --dev -U
|
||||||
|
|
||||||
|
|
@ -24,8 +30,5 @@ jobs:
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: ruff format --check --verbose
|
run: ruff format --check --verbose
|
||||||
|
|
||||||
- name: Lint Dockerfile (build only)
|
|
||||||
run: docker build --check .
|
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: uv run pytest
|
run: uv run pytest
|
||||||
21
Dockerfile
21
Dockerfile
|
|
@ -1,21 +0,0 @@
|
||||||
# syntax=docker/dockerfile:1
|
|
||||||
# check=error=true;experimental=all
|
|
||||||
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim
|
|
||||||
|
|
||||||
# Change the working directory to the `app` directory
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
||||||
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
|
||||||
uv sync --no-install-project
|
|
||||||
|
|
||||||
# Copy the application file
|
|
||||||
COPY main.py /app/
|
|
||||||
|
|
||||||
# Set the environment variables
|
|
||||||
ENV PYTHONUNBUFFERED=1
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
|
||||||
|
|
||||||
# Run the application
|
|
||||||
CMD ["uv", "run", "main.py"]
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
services:
|
|
||||||
anewdawn:
|
|
||||||
image: ghcr.io/thelovinator1/anewdawn:latest
|
|
||||||
container_name: anewdawn
|
|
||||||
env_file: .env
|
|
||||||
environment:
|
|
||||||
- DISCORD_TOKEN=${DISCORD_TOKEN}
|
|
||||||
- OPENAI_TOKEN=${OPENAI_TOKEN}
|
|
||||||
restart: unless-stopped
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue