From b784ff2549e009f6acb69515e75468662164410e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 14 Jul 2025 17:27:28 +0200 Subject: [PATCH 1/2] Move markdownlint to pre-commit --- .github/workflows/check-markdown.yml | 14 -------------- .pre-commit-config.yaml | 8 ++++++++ 2 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/check-markdown.yml diff --git a/.github/workflows/check-markdown.yml b/.github/workflows/check-markdown.yml deleted file mode 100644 index 63a0df9a..00000000 --- a/.github/workflows/check-markdown.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Lint docs -on: [push, pull_request] -jobs: - check_md: - runs-on: ubuntu-latest - steps: - - name: Check out repository - uses: actions/checkout@v2 - - name: Lint markdown files (markdownlint) - uses: articulate/actions-markdownlint@v1 - with: - config: .markdownlint.json - files: '.' - ignore: changelog-entries diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e826827..4a43dc1f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,11 @@ repos: hooks: - id: check-github-workflows args: ["--verbose"] + +- repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.39.0 + hooks: + - id: markdownlint + exclude: "^changelog-entries/" + - id: markdownlint-fix + exclude: "^changelog-entries/" From 44d231b419271621c97569b1e46273400eddc5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Mon, 14 Jul 2025 17:23:24 +0200 Subject: [PATCH 2/2] Merge CI --- .github/workflows/build-and-test.yml | 57 +++++++++++++++++++++++++-- .github/workflows/check-pep8.yml | 21 ---------- .github/workflows/run-solverdummy.yml | 39 ------------------ 3 files changed, 54 insertions(+), 63 deletions(-) delete mode 100644 .github/workflows/check-pep8.yml delete mode 100644 .github/workflows/run-solverdummy.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a844bf12..cff2df95 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -6,10 +6,28 @@ on: pull_request: branches: - "*" + workflow_dispatch: + +concurrency: + group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{github.event_name == 'pull_request'}} jobs: + pre-commit: + name: pre-commit checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 + run_tox: - name: Run mocked tests + name: mocked tests + needs: [pre-commit] runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -39,8 +57,40 @@ jobs: export PKG_CONFIG_PATH=$(readlink -f "precice-core/build") tox + build_dist: + name: build distributions + needs: [pre-commit] + runs-on: ubuntu-latest + container: + image: precice/precice:nightly + options: --user root + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Configure safe directory + run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Install dependencies + run: | + apt-get -yy update + apt-get install -y python3-pip python3.12-venv pkg-config pipx + rm -rf /var/lib/apt/lists/* + - name: Install pyproject-build + run: | + pipx install build + - name: Build sdist + run: | + export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + $HOME/.local/bin/pyproject-build -s + - name: Build wheel + run: | + export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + $HOME/.local/bin/pyproject-build -w + pip_install: - name: Run pip install + name: pip install + needs: [pre-commit] runs-on: ubuntu-latest container: image: precice/precice:nightly @@ -69,8 +119,9 @@ jobs: .venv/bin/python3 -c "import precice; print(precice.__version__)" .venv/bin/python3 -c "import precice; print(precice.get_version_information())" + solverdummy_test: - name: Run solverdummy + name: solverdummies needs: [pip_install] runs-on: ubuntu-latest container: diff --git a/.github/workflows/check-pep8.yml b/.github/workflows/check-pep8.yml deleted file mode 100644 index 96a8cff8..00000000 --- a/.github/workflows/check-pep8.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: autopep8 -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" -jobs: - autopep8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: autopep8 - id: autopep8 - uses: peter-evans/autopep8@v1 - with: - args: --recursive --diff --aggressive --aggressive --exit-code --ignore E402 --max-line-length 120 . - - name: Fail if autopep8 made changes - if: ${{ steps.autopep8.outputs.exit-code == 2 }} - run: exit 1 diff --git a/.github/workflows/run-solverdummy.yml b/.github/workflows/run-solverdummy.yml deleted file mode 100644 index 8c268ada..00000000 --- a/.github/workflows/run-solverdummy.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Run preCICE Solverdummies -on: - push: - branches: - - "*" - pull_request: - branches: - - "*" -jobs: - run_solverdummies: - name: Run solverdummies - runs-on: ubuntu-latest - container: - image: precice/precice:nightly - options: --user root - steps: - - name: Checkout Repository - uses: actions/checkout@v2 - - name: Install Dependencies - run: | - apt-get -qq update - apt-get -qq install software-properties-common python3-dev python3-pip python3.12-venv git apt-utils pkg-config - rm -rf /var/lib/apt/lists/* - - name: Create venv - run: | - python3 -m venv .venv - - name: Activate venv - # see https://stackoverflow.com/a/74669486 - run: | - . .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV - - name: Install bindings - run: pip3 install . - - name: Check whether preCICE was built with MPI # reformat version information as a dict and check whether preCICE was compiled with MPI - run: python3 -c "import precice; assert({item.split('=')[0]:item.split('=')[-1] for item in str(precice.get_version_information()).split(';')}['PRECICE_FEATURE_MPI_COMMUNICATION']=='Y')" - - name: Run solverdummies - run: | - cd examples/solverdummy/ - python3 solverdummy.py precice-config.xml SolverOne & python3 solverdummy.py precice-config.xml SolverTwo