diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da043529..438f0182 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: [push, pull_request] jobs: lint-commitlint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -33,10 +33,10 @@ jobs: - name: Check commit message compliance of the pull request if: github.event_name == 'pull_request' run: | - ./run-tests.sh --check-commitlint ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} + ./run-tests.sh --check-commitlint ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.number }} lint-shellcheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: ./run-tests.sh --check-shellcheck lint-black: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -55,7 +55,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check Python code formatting run: | @@ -63,7 +63,7 @@ jobs: ./run-tests.sh --check-black lint-flake8: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -71,7 +71,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check compliance with pep8, pyflakes and circular complexity run: | @@ -79,7 +79,7 @@ jobs: ./run-tests.sh --check-flake8 lint-pydocstyle: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check compliance with Python docstring conventions run: | @@ -95,7 +95,7 @@ jobs: ./run-tests.sh --check-pydocstyle lint-check-manifest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -103,7 +103,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Check Python manifest completeness run: | @@ -111,7 +111,7 @@ jobs: ./run-tests.sh --check-manifest docs-sphinx: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 @@ -119,7 +119,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.12" - name: Install system dependencies run: | @@ -140,7 +140,7 @@ jobs: run: ./run-tests.sh --check-sphinx python-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] @@ -168,7 +168,7 @@ jobs: run: ./run-tests.sh --check-pytest - name: Codecov Coverage - if: matrix.python-version == '3.8' + if: matrix.python-version == '3.12' uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1240941f..32f7a2d0 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 build: - os: ubuntu-22.04 + os: ubuntu-24.04 tools: - python: "3.8" + python: "3.12" sphinx: configuration: docs/conf.py diff --git a/run-tests.sh b/run-tests.sh index aae6a42f..21266d42 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -16,15 +16,28 @@ check_commitlint () { npx commitlint --from="$from" --to="$to" found=0 while IFS= read -r line; do - if echo "$line" | grep -qP "\(\#$pr\)$"; then - true - elif echo "$line" | grep -qP "^chore\(.*\): release"; then - true - else - echo "✖ Headline does not end by '(#$pr)' PR number: $line" + commit_hash=$(echo "$line" | cut -d ' ' -f 1) + commit_title=$(echo "$line" | cut -d ' ' -f 2-) + commit_number_of_parents=$(git rev-list --parents "$commit_hash" -n1 | awk '{print NF-1}') + # (i) skip checking release commits generated by Release Please + if [ "$commit_number_of_parents" -le 1 ] && echo "$commit_title" | grep -qP "^chore\(.*\): release"; then + continue + fi + # (ii) check presence of PR number + if ! echo "$commit_title" | grep -qP "\(\#$pr\)$"; then + echo "✖ Headline does not end by '(#$pr)' PR number: $commit_title" found=1 fi - done < <(git log "$from..$to" --format="%s") + # (iii) check absence of merge commits in feature branches + if [ "$commit_number_of_parents" -gt 1 ]; then + if echo "$commit_title" | grep -qP "^chore\(.*\): merge "; then + break # skip checking maint-to-master merge commits + else + echo "✖ Merge commits are not allowed in feature branches: $commit_title" + found=1 + fi + fi + done < <(git log "$from..$to" --format="%H %s") if [ $found -gt 0 ]; then exit 1 fi diff --git a/setup.py b/setup.py index 320960a9..fbfed65f 100755 --- a/setup.py +++ b/setup.py @@ -38,11 +38,15 @@ ], "cwl": ["cwltool==3.1.20210628163208"], "snakemake": [ - "snakemake==7.32.4", + # install patched version of snakemake v7 that works with Python 3.12 + # see https://github.com/snakemake/snakemake/issues/2480 + # see https://github.com/snakemake/snakemake/issues/2648 + # see https://github.com/snakemake/snakemake/issues/2657 + "snakemake @ git+https://github.com/mdonadoni/snakemake.git@cea31624976989ad0645eb2e1751260d32259506", # branch `7.32.4-python3.12` "pulp>=2.7.0,<2.8.0", ], "snakemake-reports": [ - "snakemake[reports]==7.32.4", + "snakemake[reports] @ git+https://github.com/mdonadoni/snakemake.git@cea31624976989ad0645eb2e1751260d32259506", # branch `7.32.4-python3.12` "pulp>=2.7.0,<2.8.0", ], }