From 2cfc07767feb04d6417724b410ddb6478861bcf1 Mon Sep 17 00:00:00 2001 From: haosenwang1018 Date: Wed, 4 Mar 2026 04:15:31 +0000 Subject: [PATCH] ci: improve GitHub Actions workflow - Add separate lint job for faster feedback - Add pip caching for faster dependency installation - Add Docker build job to verify Dockerfile - Use Docker Buildx with layer caching - Check all shell scripts, not just run_loop.sh --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f25567c..7668b2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,22 @@ on: branches: [main] jobs: - lint-and-test: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Shell lint + run: | + find scripts -name '*.sh' | while read f; do + echo "Checking $f" + bash -n "$f" + done + + - name: Check install script + run: bash -n install.sh + + test: runs-on: ubuntu-latest strategy: matrix: @@ -15,9 +30,11 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Syntax check (py_compile) run: | @@ -32,5 +49,19 @@ jobs: - name: Run tests run: pytest tests/ -v - - name: Shell lint (bash -n) - run: bash -n scripts/run_loop.sh + docker-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: false + tags: edict:test + cache-from: type=gha + cache-to: type=gha,mode=max