diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 70b51b039ab..e03237ed347 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -1,4 +1,4 @@ -name: Build and test ERT and docs +name: Build and test on: push: @@ -29,7 +29,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - test-linux: + test-linux-ert: strategy: fail-fast: false matrix: @@ -43,6 +43,20 @@ jobs: test-type: ${{ matrix.test-type }} secrets: inherit + test-linux-everest: + strategy: + fail-fast: false + matrix: + test-type: [ 'test', 'ui-test', 'integration-test', 'everest-models-test', 'doc', 'everest-docs-entry-test' ] + python-version: [ '3.8', '3.11', '3.12' ] + os: [ ubuntu-latest ] + uses: ./.github/workflows/test_everest.yml + with: + os: ${{ matrix.os }} + python-version: ${{ matrix.python-version }} + test-type: ${{ matrix.test-type }} + secrets: inherit + test-slurm: strategy: fail-fast: false @@ -55,12 +69,43 @@ jobs: python-version: ${{ matrix.python-version }} secrets: inherit - test-mac-for-tags: - if: github.ref_type == 'tag' # only test all variants for tags + test-mac-ert: + if: github.ref_type != 'tag' # when not tag strategy: fail-fast: false matrix: test-type: [ 'performance-tests', '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 + + test-mac-everest: + if: github.ref_type != 'tag' # when not tag + strategy: + fail-fast: false + matrix: + test-type: [ 'test', 'integration-test', 'everest-models-test' ] + 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 + + + test-mac-for-tags-everest: + if: github.ref_type == 'tag' # only test all variants for tags + strategy: + fail-fast: false + matrix: + test-type: [ 'test', 'integration-test', 'everest-models-test' ] python-version: [ '3.8', '3.12' ] os: [ 'macos-13', 'macos-14'] exclude: @@ -68,22 +113,27 @@ jobs: python-version: '3.8' - os: 'macos-13' python-version: '3.12' - - uses: ./.github/workflows/test_ert.yml + uses: ./.github/workflows/test_everest.yml with: os: ${{ matrix.os }} python-version: ${{ matrix.python-version }} test-type: ${{ matrix.test-type }} secrets: inherit - test-mac: - if: github.ref_type != 'tag' # when not tag + test-mac-for-tags-ert: + if: github.ref_type == 'tag' # only test all variants for tags strategy: fail-fast: false matrix: test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ] - python-version: [ '3.12' ] - os: [ 'macos-latest' ] + python-version: [ '3.8', '3.12' ] + os: [ 'macos-13', 'macos-14'] + exclude: + - os: 'macos-14' + python-version: '3.8' + - os: 'macos-13' + python-version: '3.12' + uses: ./.github/workflows/test_ert.yml with: os: ${{ matrix.os }} @@ -139,7 +189,7 @@ jobs: publish: name: Publish to PyPI runs-on: ubuntu-latest - needs: [build-wheels, test-linux, test-mac-for-tags, docs-ert] + needs: [build-wheels, test-linux-ert, test-linux-everest, test-mac-for-tags-ert, test-mac-for-tags-everest, docs-ert] permissions: id-token: write diff --git a/.github/workflows/test_everest.yml b/.github/workflows/test_everest.yml index 61ba3c4a9a1..d577d5ff475 100644 --- a/.github/workflows/test_everest.yml +++ b/.github/workflows/test_everest.yml @@ -1,79 +1,87 @@ name: everest-run-tests-build-docs on: - pull_request: - workflow_dispatch: - push: - branches: - - main - tags: "*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + workflow_call: + inputs: + os: + type: string + python-version: + type: string + test-type: + type: string env: NO_PROJECT_RES: 1 UV_SYSTEM_PYTHON: 1 jobs: - tests: - name: "py_${{ matrix.python-version }}_${{ matrix.test_type }}" + tests-everest: + name: Run everest tests timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - python-version: ['3.8', '3.11', '3.12'] - os: [ubuntu-latest] - test_type: ['doc', 'ui-test', 'test', 'integration-test', 'everest-models-test'] - runs-on: ${{ matrix.os }} + runs-on: ${{ inputs.os }} + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} + + - name: Set up Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ inputs.python-version }} - name: Install uv uses: astral-sh/setup-uv@v3 + - name: Install HDF5 source files on mac + if: ${{ inputs.os == 'macOS' && (inputs.python-version == '3.8' || inputs.python-version == '3.9' )}} + run: brew install hdf5 + - name: Install Everest and dependencies run: | uv pip install ".[dev,everest]" - - name: Run Tests - if: matrix.test_type == 'test' + - name: Run Tests Linux + if: ${{ inputs.test-type == 'test' && inputs.os != 'macOS'}} run: | pytest tests/everest -n 4 -m "not ui_test and not integration_test" --dist loadgroup -sv - - name: Run Integration Tests - if: matrix.test_type == 'integration-test' + - name: Run Tests macOS + if: ${{ inputs.test-type == 'test' && inputs.os == 'macOS'}} + run: | + python -m pytest tests/everest -n 4 -m "not ui_test and not integration_test and not fails_on_macos_github_workflow" --dist loadgroup -sv + + - name: Run Integration Tests Linux + if: ${{inputs.test-type == 'integration-test' && inputs.os != 'macOS'}} run: | pytest tests/everest -n 4 -m "integration_test" --dist loadgroup + - name: Run Integration Tests macOS + if: ${{inputs.test-type == 'integration-test' && inputs.os == 'macOS'}} + run: | + python -m pytest tests/everest -n 4 -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup + - name: Run UI Tests - if: matrix.test_type == 'ui-test' + if: inputs.test-type == 'ui-test' env: QT_QPA_PLATFORM: 'minimal' run: | python -m pytest tests/everest -m "ui_test" - name: Build Documentation - if: matrix.test_type == 'doc' + if: inputs.test-type == 'doc' run: | uv pip install git+https://github.com/equinor/everest-models.git mkdir tmp sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs - name: Run tests requiring everest-models - if: matrix.test_type == 'everest-models-test' + if: inputs.test-type == 'everest-models-test' run: | uv pip install git+https://github.com/equinor/everest-models.git python -m pytest tests/everest -n 4 -m everest_models_test --dist loadgroup - name: Test docs entry point - if: matrix.test_type == 'everest-docs-entry-test' + if: inputs.test-type == 'everest-docs-entry-test' run: | python -m everest.docs diff --git a/.github/workflows/test_everest_macos.yml b/.github/workflows/test_everest_macos.yml deleted file mode 100644 index 632a132427e..00000000000 --- a/.github/workflows/test_everest_macos.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: everest-macos-run-tests-build-docs - -on: - pull_request: - workflow_dispatch: - push: - branches: - - main - tags: "*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -env: - NO_PROJECT_RES: 1 - UV_SYSTEM_PYTHON: 1 - -jobs: - tests: - if: github.ref_type == 'tag' # only build for mac when tags - name: "py-${{ matrix.python-version }}_${{ matrix.test_type }}_${{ matrix.os }}" - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - python-version: ['3.8', '3.12'] - os: ['macos-13', 'macos-14', 'macos-14-large'] - # https://github.com/actions/runner-images/tree/main?tab=readme-ov-file#available-images - exclude: - - os: 'macos-14' - python-version: '3.8' - - os: 'macos-14-large' - python-version: '3.8' - - os: 'macos-13' - python-version: '3.12' - - test_type: ['doc', 'test', 'integration-test', 'everest-models-test'] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install uv - uses: astral-sh/setup-uv@v3 - - - name: Install HDF5 source files - if: ${{ runner.os == 'macOS' && (matrix.python-version == '3.8' || matrix.python-version == '3.9' )}} - run: brew install hdf5 - - - name: Install Everest and dependencies - run: | - uv pip install .[dev, everest] - - - name: Run Tests - if: matrix.test_type == 'test' - run: | - python -m pytest tests/everest -n 4 -m "not ui_test and not integration_test and not fails_on_macos_github_workflow" --dist loadgroup - - - name: Run Integration Tests - if: matrix.test_type == 'integration-test' - run: | - python -m pytest tests/everest -n 4 -m "integration_test and not fails_on_macos_github_workflow" --dist loadgroup - - - name: Build Documentation - if: matrix.test_type == 'doc' - run: | - uv pip install git+https://github.com/equinor/everest-models.git - mkdir tmp - sphinx-build -n -v -E -W ./docs/everest ./tmp/everest_docs - - - name: Run tests requiring everest-models - if: matrix.test_type == 'everest-models-test' - run: | - uv pip install git+https://github.com/equinor/everest-models.git - python -m pytest tests/everest -n 4 -m everest_models_test --dist loadgroup