From 8b05d3930f7d7af11b043a916dee0dcaf97a2e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Fri, 22 May 2026 17:25:48 +0200 Subject: [PATCH] poc for same-repo commenting --- .github/workflows/backport.yml | 37 --- .github/workflows/build-wheels.yml | 35 --- .github/workflows/build_and_test.yml | 239 ------------------ .github/workflows/codspeed.yml | 45 ---- .github/workflows/poc.yml | 24 ++ .../workflows/run_ert_test_data_setups.yml | 69 ----- .github/workflows/run_pre_commit.yml | 66 ----- .github/workflows/test_ert.yml | 142 ----------- .github/workflows/test_ert_with_flow.yml | 91 ------- .../workflows/test_ert_with_site_config.yml | 93 ------- .github/workflows/test_ert_with_slurm.yml | 122 --------- .github/workflows/test_everest.yml | 123 --------- .github/workflows/test_everest_models.yml | 66 ----- .github/workflows/test_screenshots.yml | 71 ------ .github/workflows/test_semeio.yml | 67 ----- .github/workflows/typing.yml | 57 ----- .github/workflows/update_lockfile.yml | 50 ---- 17 files changed, 24 insertions(+), 1373 deletions(-) delete mode 100644 .github/workflows/backport.yml delete mode 100644 .github/workflows/build-wheels.yml delete mode 100644 .github/workflows/build_and_test.yml delete mode 100644 .github/workflows/codspeed.yml create mode 100644 .github/workflows/poc.yml delete mode 100644 .github/workflows/run_ert_test_data_setups.yml delete mode 100644 .github/workflows/run_pre_commit.yml delete mode 100644 .github/workflows/test_ert.yml delete mode 100644 .github/workflows/test_ert_with_flow.yml delete mode 100644 .github/workflows/test_ert_with_site_config.yml delete mode 100644 .github/workflows/test_ert_with_slurm.yml delete mode 100644 .github/workflows/test_everest.yml delete mode 100644 .github/workflows/test_everest_models.yml delete mode 100644 .github/workflows/test_screenshots.yml delete mode 100644 .github/workflows/test_semeio.yml delete mode 100644 .github/workflows/typing.yml delete mode 100644 .github/workflows/update_lockfile.yml diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml deleted file mode 100644 index 6625b180c48..00000000000 --- a/.github/workflows/backport.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Backport merged pull request -on: - pull_request_target: - types: - - closed - - labeled -permissions: - contents: write # so it can comment - pull-requests: write # so it can create pull requests -jobs: - backport: - name: Backport pull request - runs-on: ubuntu-latest - # Don't run on closed unmerged pull requests - if: > - github.event.pull_request.merged - && ( - github.event.action == 'closed' - || ( - github.event.action == 'labeled' - && contains(github.event.label.name, 'backport') - ) - ) - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Generate token - id: generate-token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - with: - app-id: ${{ vars.SCOUT_TEAM_APP_ID }} - private-key: ${{ secrets.SCOUT_TEAM_APP_PRIVATE_KEY }} - - name: Create backport pull requests - uses: korthout/backport-action@66065406958f46e82238fd59546f5a99e69e22aa # v4.5.2 - with: - add_author_as_assignee: true - copy_labels_pattern: release-notes:.* - github_token: ${{ steps.generate-token.outputs.token }} diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml deleted file mode 100644 index 700fd803ded..00000000000 --- a/.github/workflows/build-wheels.yml +++ /dev/null @@ -1,35 +0,0 @@ -on: - workflow_call: - inputs: - python-version: - type: string - -permissions: - contents: read - -jobs: - build-wheels: - timeout-minutes: 10 - strategy: - fail-fast: false - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ inputs.python-version }} - - - name: Build wheels - run: pip wheel -w dist --no-deps . - - - name: Upload wheel as artifact - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: ubuntu-latest Python ${{ inputs.python-version }} wheel - path: dist/* diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml deleted file mode 100644 index b7964b29fc9..00000000000 --- a/.github/workflows/build_and_test.yml +++ /dev/null @@ -1,239 +0,0 @@ -name: Build and test - -on: - push: - branches: - - main - - 'version-**' - tags: "*" - pull_request: - -permissions: - contents: read - -env: - ERT_SHOW_BACKTRACE: 1 # resdata print on failure https://github.com/equinor/resdata/blob/5fdf0280726a2670161ed536705dc9156aea39be/lib/util/util_abort.cpp#L96 - UV_FROZEN: true # https://docs.astral.sh/uv/configuration/environment/#uv_frozen - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -jobs: - run-pre-commit: - uses: ./.github/workflows/run_pre_commit.yml - - check-typing: - uses: ./.github/workflows/typing.yml - - run-testdata: - needs: [run-pre-commit, check-typing] - uses: ./.github/workflows/run_ert_test_data_setups.yml - - run-dummy-site-config: - needs: [run-pre-commit, check-typing] - uses: ./.github/workflows/test_ert_with_site_config.yml - - build-wheels: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - python-version: [ '3.11', '3.12', '3.13', '3.14' ] - - uses: ./.github/workflows/build-wheels.yml - with: - python-version: ${{ matrix.python-version }} - - test-linux-ert: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - test-type: [ 'performance-and-unit-tests', 'gui-tests', 'cli-tests', 'fuzz' ] - python-version: [ '3.11', '3.12', '3.13', '3.14' ] - os: [ ubuntu-latest ] - uses: ./.github/workflows/test_ert.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - test-type: ${{ matrix.test-type }} - secrets: inherit - - test-linux-everest: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - test-type: [ 'test', 'doc' ] - python-version: [ '3.11', '3.12', '3.13', '3.14' ] - os: [ ubuntu-latest ] - exclude: - - os: 'ubuntu-latest' - test-type: 'doc' - python-version: '3.11' - - os: 'ubuntu-latest' - test-type: 'doc' - python-version: '3.12' - - os: 'ubuntu-latest' - test-type: 'doc' - python-version: '3.14' - uses: ./.github/workflows/test_everest.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - test-type: ${{ matrix.test-type }} - secrets: inherit - - test-screenshots: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - python-version: [ '3.12' ] - os: [ ubuntu-latest ] - uses: ./.github/workflows/test_screenshots.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - secrets: inherit - - test-slurm: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ '3.14' ] - uses: ./.github/workflows/test_ert_with_slurm.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - secrets: inherit - - test-ert-with-flow: - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ '3.14' ] - uses: ./.github/workflows/test_ert_with_flow.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - secrets: inherit - - test-mac-main-everest: - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') # only perform mac tests on main branch and tags - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - test-type: [ 'test' ] - os: [ 'macos-latest' ] - python-version: [ '3.12' ] - - uses: ./.github/workflows/test_everest.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - test-type: ${{ matrix.test-type }} - secrets: inherit - - test-mac-main-ert: - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') # only perform mac tests on main branch and tags - needs: [run-pre-commit, check-typing] - strategy: - fail-fast: false - matrix: - test-type: [ 'performance-and-unit-tests', 'gui-tests', 'cli-tests' ] - python-version: [ '3.12' ] - os: [ 'macos-latest'] - - uses: ./.github/workflows/test_ert.yml - with: - os: ${{ matrix.os }} - python-version: ${{ matrix.python-version }} - test-type: ${{ matrix.test-type }} - secrets: inherit - - docs-ert: - needs: [run-pre-commit, check-typing] - name: Test ert docs - strategy: - fail-fast: false - matrix: - python-version: ['3.14'] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ matrix.os }} - - - name: Install pandoc - run: | - sudo apt install pandoc - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - id: setup_python - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ert - run: | - uv sync --group dev - - - name: Test docs - run: | - uv run just build-ert-docs - - run-codspeed: - needs: [build-wheels, test-linux-ert, test-linux-everest, test-slurm, test-ert-with-flow, run-testdata, run-dummy-site-config, docs-ert] - uses: ./.github/workflows/codspeed.yml - - test_everest_models: - needs: [build-wheels, test-linux-ert, test-linux-everest, test-slurm, test-ert-with-flow, run-testdata, run-dummy-site-config, docs-ert] - uses: ./.github/workflows/test_everest_models.yml - - test_semeio: - needs: [build-wheels, test-linux-ert, test-linux-everest, test-slurm, test-ert-with-flow, run-testdata, run-dummy-site-config, docs-ert] - uses: ./.github/workflows/test_semeio.yml - - publish: - name: Publish to PyPI - runs-on: ubuntu-latest - needs: [build-wheels, test-linux-ert, test-linux-everest, test-mac-main-ert, test-mac-main-everest, test-slurm, test-ert-with-flow, run-testdata, run-dummy-site-config, docs-ert] - permissions: - id-token: write - - # If this is a tagged release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - - steps: - - name: Get wheels - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: artifacts - - - name: Move to dist/ - run: | - mkdir dist - find artifacts -name "*.whl" -exec mv '{}' dist/ \; - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml deleted file mode 100644 index ccbc692e439..00000000000 --- a/.github/workflows/codspeed.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: CodSpeed - -on: - push: - branches: - - "main" - workflow_dispatch: - workflow_call: - -permissions: - contents: read - -env: - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - benchmarks: - name: Run benchmarks - runs-on: ubuntu-latest - timeout-minutes: 40 - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: ./.github/actions/install_dependencies_qt - with: - os: ubuntu-latest - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: '3.12' - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: '3.12' - - run: | - uv sync --group dev - uv pip uninstall pytest-benchmark - uv pip install pytest-codspeed - - uses: CodSpeedHQ/action@3194d9a39c4d46684cb44bf7207fc56626aad8fd # v4.15.1 - with: - mode: simulation - token: ${{ secrets.CODSPEED_TOKEN }} - run: | - uv run pytest tests/ert/performance_tests --codspeed --timeout=1200 -m "not memory_test" diff --git a/.github/workflows/poc.yml b/.github/workflows/poc.yml new file mode 100644 index 00000000000..151f2c4bf40 --- /dev/null +++ b/.github/workflows/poc.yml @@ -0,0 +1,24 @@ +name: Comment on PR + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + issues: write + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Add PR comment + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + gh api \ + "repos/$REPO/issues/$PR_NUMBER/comments" \ + -f body='Image diff workflow ran successfully.' diff --git a/.github/workflows/run_ert_test_data_setups.yml b/.github/workflows/run_ert_test_data_setups.yml deleted file mode 100644 index 5d86e92e5b2..00000000000 --- a/.github/workflows/run_ert_test_data_setups.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Run test-data - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - workflow_dispatch: - -permissions: - contents: read - -env: - ERT_SHOW_BACKTRACE: 1 - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - run-ert-test-data: - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - python-version: ['3.11', '3.12'] - os: [ubuntu-latest] - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ERT and dependencies - run: | - uv sync - - - name: Test poly example - run: | - pushd test-data/ert/poly_example - uv run ert test_run poly.ert - popd - - - name: Test snake_oil - run: | - pushd test-data/ert/snake_oil - uv pip install oil_reservoir_synthesizer resdata - uv run ert test_run snake_oil.ert - popd - - - name: Test snake_oil_field - run: | - pushd test-data/ert/snake_oil_field - uv run ert test_run snake_oil.ert - popd diff --git a/.github/workflows/run_pre_commit.yml b/.github/workflows/run_pre_commit.yml deleted file mode 100644 index d9464ce0fb0..00000000000 --- a/.github/workflows/run_pre_commit.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Run pre-commit - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - -permissions: - contents: read - -env: - UV_FROZEN: true - -jobs: - check-style: - timeout-minutes: 15 - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.12'] - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ERT with style dependencies - run: | - uv sync --group style - - - name: Download shellcheck - run: | - sudo apt-get update - sudo apt-get install shellcheck - - name: Check testkomodo.sh - run: shellcheck -s bash ci/testkomodo.sh - shell: bash - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ubuntu-latest - - - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: ~/.cache/pre-commit - key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} - - - name: Run pre-commit - if: ${{ always() }} - run: | - SKIP=no-commit-to-branch uv run pre-commit run --all-files --hook-stage pre-push --show-diff-on-failure diff --git a/.github/workflows/test_ert.yml b/.github/workflows/test_ert.yml deleted file mode 100644 index 95fbefc8a8b..00000000000 --- a/.github/workflows/test_ert.yml +++ /dev/null @@ -1,142 +0,0 @@ -on: - workflow_call: - inputs: - os: - type: string - python-version: - type: string - test-type: - type: string - -permissions: - contents: read - -env: - ERT_SHOW_BACKTRACE: 1 - ERT_PYTEST_ARGS: '--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_main.xml --junit-xml=junit.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - tests-ert: - name: Run ert tests - runs-on: ${{ inputs.os }} - timeout-minutes: 30 - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - submodules: true - lfs: true - - - if: ${{ inputs.os == 'macos-latest' }} - run: echo "ERT_TESTS_RUN_ON_MAC_CI=true" >> "$GITHUB_ENV" - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ inputs.os }} - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - id: setup_python - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ inputs.python-version }} - - - name: Install ert - run: | - uv sync --group dev - - - name: GUI Test - if: inputs.test-type == 'gui-tests' - run: | - touch storage - chmod 000 storage - uv run just ert-gui-tests - chmod 700 storage - rm storage - - - name: Fuzzing - if: inputs.test-type == 'fuzz' - run: | - touch storage - chmod 000 storage - uv run just fuzz - chmod 700 storage - rm storage - - - name: CLI Test - if: inputs.test-type == 'cli-tests' - run: | - touch storage - chmod 000 storage - uv run just ert-cli-tests - chmod 700 storage - rm storage - - - name: Unit Test - if: inputs.test-type == 'performance-and-unit-tests' - run: | - touch storage - chmod 000 storage - uv run just ert-unit-tests - ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_docs.xml --junit-xml=junit-doc.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' uv run just ert-doc-tests - ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov_mem.xml --junit-xml=junit-mem.xml -o junit_family=legacy -v --durations=25 --benchmark-disable' uv run just ert-memory-tests - chmod 700 storage - rm storage - - - name: Upload coverage to Codecov - id: codecov1 - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - continue-on-error: true - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: cov_main.xml,cov_docs.xml,cov_mem.xml - flags: ${{ inputs.test-type }} - - name: codecov retry sleep - if: steps.codecov1.outcome == 'failure' - run: | - sleep 30 - - name: Codecov retry - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - if: steps.codecov1.outcome == 'failure' - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: cov_main.xml,cov_docs.xml,cov_mem.xml - flags: ${{ inputs.test-type }} - fail_ci_if_error: ${{ github.ref == 'refs/heads/main' }} - - - uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2.6 - if: ${{ !cancelled() }} - continue-on-error: true - with: - paths: junit*.xml - - - name: Upload test results to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Test CLI - run: | - uv run ert --help - - - name: Test for a clean repository - run: | - # Remove things we have generated on purpose: - ls -la - rm -rf .coverage - rm -f coverage.xml cov_main.xml cov_docs.xml cov_mem.xml junit*.xml - rm -f ert.*.whl - rm -f codecov.SHA* - rm -f codecov - rm -f .coverage.* - git status --porcelain - test -z "$(git status --porcelain)" diff --git a/.github/workflows/test_ert_with_flow.yml b/.github/workflows/test_ert_with_flow.yml deleted file mode 100644 index d388e5ae40e..00000000000 --- a/.github/workflows/test_ert_with_flow.yml +++ /dev/null @@ -1,91 +0,0 @@ -on: - workflow_call: - inputs: - os: - type: string - python-version: - type: string - -permissions: - contents: read - -env: - UV_FROZEN: true - -jobs: - test-ert-with-flow: - name: Run ert tests - timeout-minutes: 20 - runs-on: ${{ inputs.os }} - - steps: - - name: Check /etc/hosts - run: | - echo "/etc/hosts ::" - cat /etc/hosts - if grep -q '^-' /etc/hosts; then - echo "Found corrupted /etc/hosts - attempting fix" - sudo sed -i s'/^-[^ ] //' /etc/hosts - echo "/etc/hosts ::" - cat /etc/hosts - fi - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ inputs.os }} - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - id: setup_python - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ inputs.python-version }} - - - name: Install ert and everest - run: | - uv sync --group dev - uv pip install git+https://github.com/equinor/everest-models - - - name: Install flow - run: | - set -e - sudo apt install software-properties-common - sudo apt-add-repository ppa:opm/ppa - sudo apt update - sudo apt install mpi-default-bin - sudo apt install libopm-simulators-bin python3-opm-common - - which flow - flow --version - - - name: Run integration tests towards OPM flow without flowrun - run: | - set -e - uv run pytest tests/ert/unit_tests/resources/test_run_flow_simulator.py - - - name: Run Ert on an example configuration with flow - run: | - pushd test-data/ert/flow_example - perl -p -i -e 's/NUM_REALIZATIONS\s*12/NUM_REALIZATIONS 2/g' flow.ert - uv run ert ensemble_experiment --disable-monitoring flow.ert - popd - - - name: Run update with rft observations - run: | - set -e - uv run pytest tests/ert/ui_tests/cli/test_update_with_rft_observations.py - - - name: Run EVEREST on an example configuration with flow - run: | - pushd test-data/everest/eightcells/everest/model - yq eval '.model.realizations = [0, 1]' -i config.yml - yq eval '.simulator.queue_system.max_running = 4' -i config.yml - uv run everest lint config.yml - uv run everest run config.yml --skip-prompt --disable-monitoring - popd diff --git a/.github/workflows/test_ert_with_site_config.yml b/.github/workflows/test_ert_with_site_config.yml deleted file mode 100644 index 5699650790a..00000000000 --- a/.github/workflows/test_ert_with_site_config.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Run ERT tests against dummy site config - -permissions: - contents: read - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - workflow_dispatch: - -jobs: - test-against-lsf: - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: ['ubuntu-latest'] - test-type: [ 'gui-tests', 'rapid-tests' ] - python-version: ["3.12"] - - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ matrix.os }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ERT + dummy plugin package that sets site config - run: | - set -euo pipefail - - # Create package structure - mkdir -p dummy_site_config/dummy_plugin - - # --- pyproject.toml --- - cat > dummy_site_config/pyproject.toml <<'END_OF_FILE' - [build-system] - requires = ["setuptools"] - build-backend = "setuptools.build_meta" - - [project] - name = "dummy-site-configuration" - version = "0.1.0" - description = "Dummy ERT plugin for testing" - requires-python = ">=3.12" - - [project.entry-points.ert] - dummy_site_config = "dummy_plugin" - END_OF_FILE - - # --- __init__.py --- - cat > dummy_site_config/dummy_plugin/__init__.py <<'END_OF_FILE' - from ert import plugin - from ert.plugins import ErtRuntimePlugins - from ert.config.queue_config import LsfQueueOptions - - @plugin(name="fmu-site-configuration") - def site_configurations(): - return ErtRuntimePlugins( - queue_options=LsfQueueOptions( - lsf_resource="select[cs && x86_64Linux]", - lsf_queue="mr", - max_running=10000, - submit_sleep=1, - realization_memory=10737418240 - ), - ) - END_OF_FILE - - # Install the dummy package - uv sync --group dev - uv pip install ./dummy_site_config - - - name: Rapid tests - if: matrix.test-type == 'rapid-tests' - run: | - uv run just rapid-tests diff --git a/.github/workflows/test_ert_with_slurm.yml b/.github/workflows/test_ert_with_slurm.yml deleted file mode 100644 index fcdb2a84061..00000000000 --- a/.github/workflows/test_ert_with_slurm.yml +++ /dev/null @@ -1,122 +0,0 @@ -on: - workflow_call: - inputs: - os: - type: string - python-version: - type: string - -permissions: - contents: read - -env: - UV_FROZEN: true - -jobs: - test-ert-on-slurm: - name: Run ert tests - timeout-minutes: 20 - runs-on: ubuntu-24.04 - - steps: - - name: Check /etc/hosts - run: | - echo "/etc/hosts ::" - cat /etc/hosts - if grep -q '^-' /etc/hosts; then - echo "Found corrupted /etc/hosts - attempting fix" - sudo sed -i s'/^-[^ ] //' /etc/hosts - echo "/etc/hosts ::" - cat /etc/hosts - fi - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ inputs.os }} - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - id: setup_python - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ inputs.python-version }} - - - name: Install ert - run: | - uv sync --group dev - - - name: Install and setup slurm - run: | - set -e - - sudo apt install libpmix-dev slurmd slurmctld -y - - sudo mkdir /var/spool/slurm - sudo chown slurm /var/spool/slurm - - cat < slurm.conf - ClusterName=localcluster - SlurmUser=slurm - SlurmctldHost=localhost - SchedulerType=sched/builtin # Avoid default backfill scheduler which adds delays - SelectType=select/cons_tres # Select nodes based on consumable resources - SelectTypeParameters=CR_Core # Cores are the consumable resource - StateSaveLocation=/var/spool/slurm - PriorityType=priority/basic # Tests depend on FIFO scheduling - ProctrackType=proctrack/linuxproc # Use /proc to track processes - PartitionName=LocalQ Nodes=ALL Default=YES MaxTime=INFINITE State=UP - PartitionName=AlternativeQ Nodes=ALL Default=YES MaxTime=INFINITE State=UP - EOF - - # Self-configure the node: - slurmd -C | grep NodeName >> slurm.conf - - cat slurm.conf - - sudo mv slurm.conf /etc/slurm/ - sudo systemctl start slurmd # The compute node slurm daemon - sudo systemctl start slurmctld # The slurm controller daemon - sleep 1 - systemctl status slurmd - systemctl status slurmctld - - # Show partition and node information configured: - sinfo - scontrol show nodes - - - name: Verify slurm cluster works - # Timeout is set low to catch a misconfigured cluster where srun will hang. - timeout-minutes: 1 - run: | - srun env | grep SLURM - # Several SLURM_* env variables are defined only when run through slurm - - - name: Run integration tests towards Slurm - run: | - set -e - export _ERT_TESTS_ALTERNATIVE_QUEUE=AlternativeQ - uv run pytest tests/ert/unit_tests/scheduler/test_{generic,slurm}_driver.py -sv --slurm \ - -n 8 --durations=10 -k "not (LsfDriver or LocalDriver or OpenPBSDriver)" - scontrol show job - - uv run pytest tests/ert/ui_tests/cli/test_missing_runpath.py --slurm - - - name: Test poly-example on slurm - run: | - set -e - - cp -a test-data/ert/poly_example poly_slurm - pushd poly_slurm - - cat << EOF >> poly.ert - NUM_REALIZATIONS 5 - QUEUE_SYSTEM SLURM - EOF - - time uv run ert ensemble_experiment poly.ert diff --git a/.github/workflows/test_everest.yml b/.github/workflows/test_everest.yml deleted file mode 100644 index de0a205f0b3..00000000000 --- a/.github/workflows/test_everest.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: everest-run-tests-build-docs - -on: - workflow_call: - inputs: - os: - type: string - python-version: - type: string - test-type: - type: string - -permissions: - contents: read - -env: - NO_PROJECT_RES: 1 - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - tests-everest: - name: Run everest tests - timeout-minutes: 30 - runs-on: ${{ inputs.os }} - - steps: - - name: Check /etc/hosts - run: | - echo "/etc/hosts ::" - cat /etc/hosts - if grep -q '^-' /etc/hosts; then - echo "Found corrupted /etc/hosts - attempting fix" - sudo sed -i s'/^-[^ ] //' /etc/hosts - echo "/etc/hosts ::" - cat /etc/hosts - fi - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - if: ${{ inputs.os == 'macos-latest' }} - run: echo "ERT_TESTS_RUN_ON_MAC_CI=true" >> "$GITHUB_ENV" - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ inputs.os }} - - - name: Set up Python ${{ inputs.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ inputs.python-version }} - - - name: Install EVEREST and dependencies - run: | - uv sync --group dev - - - name: Run Tests Linux - if: ${{ inputs.test-type == 'test' && runner.os != 'macOS'}} - run: | - ERT_PYTEST_ARGS='--cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v' uv run just everest-tests - - - name: Run Tests macOS - if: ${{ inputs.test-type == 'test' && runner.os == 'macOS'}} - run: | - ERT_PYTEST_ARGS='-n 3 --cov=ert --cov=everest --cov=_ert --cov-report=xml:cov1.xml --junit-xml=junit.xml -o junit_family=legacy -v' uv run just everest-tests - - - name: Build Documentation - if: inputs.test-type == 'doc' - run: | - uv pip install git+https://github.com/equinor/everest-models.git - uv run just build-everest-docs - - - name: Upload coverage to Codecov - if: inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc' - id: codecov1 - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - continue-on-error: true - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: true - files: cov1.xml,cov2.xml - flags: ${{ inputs.test-type }} - - name: codecov retry sleep - if: steps.codecov1.outcome == 'failure' && inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc' - run: | - sleep 30 - - name: Codecov retry - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 - if: steps.codecov1.outcome == 'failure' && inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc' - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: cov1.xml,cov2.xml - flags: ${{ inputs.test-type }} - fail_ci_if_error: ${{ github.ref == 'refs/heads/main' }} - - - name: Upload test results to Codecov - if: ${{ !cancelled() && inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc' }} - uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1.2.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Test for a clean repository - if: ${{ inputs.test-type != 'everest-docs-entry-test' && inputs.test-type != 'doc' }} - run: | - # Remove things we have generated on purpose: - ls -la - rm -rf .coverage - rm -f coverage.xml cov1.xml cov2.xml junit.xml - rm -f ert.*.whl - rm -f codecov.SHA* - rm -f codecov - rm -f .coverage.* - git status --porcelain - test -z "$(git status --porcelain)" diff --git a/.github/workflows/test_everest_models.yml b/.github/workflows/test_everest_models.yml deleted file mode 100644 index 92127421f18..00000000000 --- a/.github/workflows/test_everest_models.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: Test EVEREST Models - -# This job checks whether current main of everest-models -# is compatible with the changes. It is not required to pass -# before merging, but breakage should be followed by fix in everest-models - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - workflow_dispatch: - -permissions: - contents: read - -env: - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - test-everest-models: - name: Test everest-models - timeout-minutes: 10 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ['3.12'] - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - name: Install dependencies - uses: ./.github/actions/install_dependencies_qt - with: - os: ubuntu-latest - - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ert - run: | - uv sync - - - name: Get everest-models - run: | - git clone https://github.com/equinor/everest-models.git - - - name: "Install and test everest-models" - run: | - pushd everest-models - VIRTUAL_ENV=../.venv uv pip install ".[test]" - UV_PROJECT_ENVIRONMENT=../.venv uv run --no-sync pytest -sv --hypothesis-profile ci --run-slow diff --git a/.github/workflows/test_screenshots.yml b/.github/workflows/test_screenshots.yml deleted file mode 100644 index b89bebca4f8..00000000000 --- a/.github/workflows/test_screenshots.yml +++ /dev/null @@ -1,71 +0,0 @@ -on: - workflow_call: - inputs: - os: - type: string - python-version: - type: string - -permissions: - contents: read - -env: - UV_FROZEN: true - -jobs: - test-screenshots: - name: Run screenshot tests - timeout-minutes: 20 - runs-on: ${{ inputs.os }} - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ${{ inputs.os }} - - - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - id: setup_python - with: - python-version: ${{ inputs.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ inputs.python-version }} - - - name: Install ert - run: | - uv sync --group dev - - - name: Run screenshot tests - run: | - uv run just screenshot-comparison-test - - - name: Pack updated screenshot in case of failure - if: ${{ failure() }} - run: | - uv run just pack_updated_screenshots - - - name: Upload updated screenshot images from failed image comparison test - id: upload-screenshot-images - if: ${{ failure() }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - continue-on-error: true - with: - name: updated-screenshots-${{ github.run_number }}-${{ github.run_id }}-${{ inputs.python-version }} - path: updated-screenshots - - - name: User instructions for fetching updated screenshots - if: ${{ failure() && steps.upload-screenshot-images.outputs.artifact-id != '' }} - run: | - echo " * Ensure gh command line utility is installed" - echo " * Do 'gh auth login' if you are not authenticated yet" - echo "$ rm -rf .tmp; gh run download ${{ github.run_id }} -D .tmp -n updated-screenshots-${{ github.run_number }}-${{ github.run_id }}-${{ inputs.python-version }}; cp -a .tmp/* ." - echo " * Then review your local changes and commit+squash them." - echo "" - echo "(This steps exits with a failure code in order to have its output highlighted in Github actions web interface)" - exit 1 diff --git a/.github/workflows/test_semeio.yml b/.github/workflows/test_semeio.yml deleted file mode 100644 index b80fab5229e..00000000000 --- a/.github/workflows/test_semeio.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Test Semeio - -# This job checks whether current main of semeio -# is compatible with the changes. It is not required to pass -# before merging, but breakage should be followed by fix in semeio -# after merge. - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - workflow_dispatch: - - -permissions: - contents: read - -env: - UV_FROZEN: true - OMP_NUM_THREADS: 1 - -jobs: - test-semeio: - name: Test Semeio - timeout-minutes: 20 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ['3.12'] - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - uses: ./.github/actions/install_dependencies_qt - with: - os: ubuntu-latest - - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ert - run: | - uv sync - - - name: Get semeio - run: | - git clone https://github.com/equinor/semeio.git - - - name: Test semeio - run: | - pushd semeio - VIRTUAL_ENV=../.venv uv pip install ".[test]" - UV_PROJECT_ENVIRONMENT=../.venv uv run --no-sync pytest -n logical --ert-integration diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml deleted file mode 100644 index 835eab41441..00000000000 --- a/.github/workflows/typing.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Type checking - -on: - push: - branches: - - main - - 'version-**' - workflow_call: - -permissions: - contents: read - -env: - UV_FROZEN: true - -jobs: - type-checking: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - python-version: ['3.12'] - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - fetch-depth: 0 - filter: tree:0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - enable-cache: true - prune-cache: false - python-version: ${{ matrix.python-version }} - - - name: Install ERT and dependencies - run: | - uv sync --group dev --group types - - - id: get-date - run: echo "todays_date=$(/bin/date -u '+%Y%m%d')" >> "$GITHUB_ENV" - - - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: .mypy_cache - key: mypy-${{ env.todays_date }} - - - run: echo ::add-matcher::.github/mypy-matcher.json - - name: Run mypy - run: | - uv run mypy src diff --git a/.github/workflows/update_lockfile.yml b/.github/workflows/update_lockfile.yml deleted file mode 100644 index 66f69bd9215..00000000000 --- a/.github/workflows/update_lockfile.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: update-lockfile - -on: - workflow_dispatch: - schedule: - - cron: "0 8 * * 1" - -permissions: - contents: write # so it can comment - pull-requests: write # so it can create pull requests - -jobs: - lock: - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - matrix: - python-version: ['3.14'] - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Python - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - with: - python-version: ${{ matrix.python-version }} - - - run: | - echo "\`\`\`" > uv_output.md - uv lock --upgrade 2>&1 | tee -a uv_output.md - echo "\`\`\`" >> uv_output.md - - - name: Create pull request - uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 - with: - token: ${{ secrets.LOCKFILE_UPDATE_TOKEN }} - commit-message: Update uv lockfile - title: Update uv lockfile - body-path: uv_output.md - branch: update-uv-lockfile - base: main - labels: dependency_workflow - delete-branch: true - add-paths: uv.lock - author: github-actions[bot] - committer: github-actions[bot]