From 0b98f2fdb3658b384328af28d356217816a81134 Mon Sep 17 00:00:00 2001 From: CoderDeltaLan Date: Wed, 10 Sep 2025 11:31:10 +0100 Subject: [PATCH] ci: ensure workflow_dispatch in CI --- .github/workflows/ci.yml | 60 +++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe2b604..a11b532 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,27 +1,37 @@ -# refresh: 2025-09-10T11:19:24Z name: CI + on: push: branches: [ main, "feat/**", "fix/**", "ci/**", "docs/**", "chore/**" ] pull_request: branches: [ main ] workflow_dispatch: {} -permissions: { contents: read } -concurrency: { group: ci-${{ github.ref }}, cancel-in-progress: true } + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: python-linux: name: Python (Linux, ${{ matrix.python-version }}) if: github.event_name != 'pull_request' || !github.event.pull_request.draft runs-on: ubuntu-latest - strategy: { fail-fast: false, matrix: { python-version: [ "3.11", "3.12" ] } } + strategy: + fail-fast: false + matrix: + python-version: [ "3.11", "3.12" ] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - with: { python-version: ${{ matrix.python-version }} } + with: + python-version: ${{ matrix.python-version }} - name: Install Poetry run: | python -m pip install --upgrade pip - pip install poetry==1.8.3 + pip install "poetry==1.8.3" poetry --version - name: Install deps run: poetry install --no-interaction @@ -33,6 +43,7 @@ jobs: run: PYTHONPATH=src poetry run pytest -q --disable-warnings - name: Mypy run: poetry run mypy . + node-linux: name: Node (Linux) if: github.event_name != 'pull_request' || !github.event.pull_request.draft @@ -40,14 +51,30 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: { node-version: 20, cache: npm } - - run: npm ci - - run: npx eslint . --max-warnings=0 - - run: npx prettier -c . --ignore-unknown - - run: | - if [ -f tsconfig.json ]; then npx tsc -p tsconfig.json --noEmit; else echo "Sin TypeScript"; fi - - run: | - if jq -e '.scripts.test' package.json >/dev/null 2>&1; then npm test; else echo "Sin tests Node"; fi + with: + node-version: 20 + cache: npm + - name: Install deps + run: npm ci + - name: ESLint + run: npx eslint . --max-warnings=0 + - name: Prettier + run: npx prettier -c . --ignore-unknown + - name: Type-check + run: | + if [ -f tsconfig.json ]; then + npx tsc -p tsconfig.json --noEmit + else + echo "Sin TypeScript" + fi + - name: Tests + run: | + if jq -e '.scripts.test' package.json >/dev/null 2>&1; then + npm test + else + echo "Sin tests Node" + fi + python-windows: name: Python (Windows opcional) if: github.event_name != 'pull_request' || !github.event.pull_request.draft @@ -56,11 +83,12 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 - with: { python-version: "3.12" } + with: + python-version: "3.12" - name: Install Poetry run: | python -m pip install --upgrade pip - pip install poetry==1.8.3 + pip install "poetry==1.8.3" poetry --version - name: Install deps run: poetry install --no-interaction