Skip to content

Commit 910377b

Browse files
authored
Merge pull request #91 from daavid00/dev
Ubuntu, macOS, and Docker installation status
2 parents 15dbb6c + e0b87da commit 910377b

8 files changed

Lines changed: 135 additions & 10 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-pycopm-docker:
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
timeout-minutes: 30
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Build Docker image
21+
run: docker build -t test-image .
22+
23+
- name: Run the hello world example in pycopm
24+
run: |
25+
docker run --rm \
26+
-u root \
27+
-v ${{ github.workspace }}:/workspace \
28+
-w /workspace \
29+
test-image \
30+
bash -c "
31+
pycopm -i examples/decks/HELLO_WORLD.DATA \
32+
-c 5,5,1 -m all -o output
33+
"
34+
35+
- name: Check if the example run
36+
run: |
37+
file="${{ github.workspace }}/output/HELLO_WORLD_PYCOPM.EGRID"
38+
if [ -f "$file" ]; then
39+
echo "pycopm succeeded"
40+
else
41+
echo "pycopm failed"
42+
exit 1
43+
fi
44+
45+
- name: Run input.toml which uses ERT
46+
run: |
47+
docker run --rm \
48+
-u root \
49+
-v ${{ github.workspace }}:/workspace \
50+
-w /workspace \
51+
test-image \
52+
bash -c "
53+
pycopm -i examples/configurations/drogon/input.toml \
54+
-o ert
55+
"
56+
57+
- name: Check if input.toml using ERT run
58+
run: |
59+
file="${{ github.workspace }}/ert/postprocessing/hm_missmatch.png"
60+
if [ -f "$file" ]; then
61+
echo "pycopm using ERT succeeded"
62+
else
63+
echo "pycopm using ERT failed"
64+
exit 1
65+
fi
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: macOS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run-pycopm-macos:
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
timeout-minutes: 60
14+
runs-on: macos-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Install OPM Flow
21+
run: |
22+
brew install cssr-tools/opm/opm-simulators
23+
24+
- name: Install python requirements
25+
run: |
26+
python3 -m venv vpycopm
27+
. vpycopm/bin/activate
28+
echo "$PWD/vpycopm/bin" >> $GITHUB_PATH
29+
pip install --upgrade pip setuptools wheel
30+
pip install -e .
31+
pip install -r dev-requirements.txt
32+
33+
- name: Run the hello world example in pycopm
34+
run: |
35+
pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output
36+
37+
- name: Check if the example run
38+
run: |
39+
file="${{ github.workspace }}/output/HELLO_WORLD_PYCOPM.EGRID"
40+
if [ -f "$file" ]; then
41+
echo "pycopm succeeded"
42+
else
43+
echo "pycopm failed"
44+
exit 1
45+
fi
46+
47+
- name: Run input.toml which uses ERT
48+
run: |
49+
pycopm -i examples/configurations/drogon/input.toml -o ert
50+
51+
- name: Check if input.toml using ERT run
52+
run: |
53+
file="${{ github.workspace }}/ert/postprocessing/hm_missmatch.png"
54+
if [ -f "$file" ]; then
55+
echo "pycopm using ERT succeeded"
56+
else
57+
echo "pycopm using ERT failed"
58+
exit 1
59+
fi

.github/workflows/ci_pycopm_ubuntu.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: Run pycopm in Ubuntu
1+
name: Ubuntu
22

33
on:
4-
push:
5-
branches:
6-
- main
74
pull_request:
85

96
jobs:
10-
run-pycopm-local:
7+
run-pycopm-ubuntu:
8+
permissions:
9+
contents: read
10+
pull-requests: write
1111
timeout-minutes: 30
1212
runs-on: ubuntu-24.04
1313
container:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Contributions are more than welcome using the fork and pull request approach
1919
1. **pytest --cov=pycopm --cov-report term-missing --basetemp=test_outputs tests/ -n auto** (this runs locally the tests, and might rise issues that need to be fixed before the pull request)
2020
1. **pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output** (this runs the hello world example, which succeeds if the file output/HELLO_WORLD_PYCOPM.EGRID is created)
2121
1. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the [_docs_](https://github.com/cssr-tools/pycopm/tree/main/docs) folder)
22-
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
22+
* Tip for Linux users: See the [_ci_pycopm_ubuntu.yml_](https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml) script and the [_Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 26.04 using Python 3.14.
2323
* Tip for macOS users: See the [_ci_pycopm_macos_.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml) script and the [_OPM-Flow_macOS Actions_](https://github.com/cssr-tools/pycopm/actions) for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.14. Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see [_ci_pycopm_macos.yml_](https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L76)).
2424
1. Squash your commits into a single commit (see this [_nice tutorial_](https://gist.github.com/lpranam/4ae996b0a4bc37448dc80356efbca7fa) if you are not familiar with this)
2525
1. Push your commit and make a pull request

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_ubuntu.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_ubuntu.yml)
2-
[![Build Status](https://github.com/daavid00/OPM-Flow_macOS/actions/workflows/ci_pycopm_macos.yml/badge.svg)](https://github.com/daavid00/OPM-Flow_macOS/actions/workflows/ci_pycopm_macos.yml)
2+
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_macos.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_macos.yml)
3+
[![Build Status](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_docker.yml/badge.svg)](https://github.com/cssr-tools/pycopm/actions/workflows/ci_pycopm_docker.yml)
34
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.11%20to%203.14-blue.svg"></a>
45
[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
56
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

docs/_sources/contributing.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Contribute to the software
3030
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs <https://github.com/cssr-tools/pycopm/tree/main/docs>`_ folder)
3131

3232
.. tip::
33-
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
33+
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 26.04 using Python 3.14.
3434
For macOS users, see the `ci_pycopm_macos.yml <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml>`_ script and the `OPM-Flow_macOS Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.14.
3535
Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/--flow** (see `this script <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72>`_).
3636

docs/contributing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ <h2>Contribute to the software<a class="headerlink" href="#contribute-to-the-sof
117117
</ol>
118118
<div class="admonition tip">
119119
<p class="admonition-title">Tip</p>
120-
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
120+
<p>See the <a class="reference external" href="https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml">ci_pycopm_ubuntu.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">Actions</a> for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 26.04 using Python 3.14.
121121
For macOS users, see the <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml">ci_pycopm_macos.yml</a> script and the <a class="reference external" href="https://github.com/cssr-tools/pycopm/actions">OPM-Flow_macOS Actions</a> for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.14.
122122
Note that if you do not add the directory containing the OPM Flow executable to your system’s PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags <strong>-f/--flow</strong> (see <a class="reference external" href="https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72">this script</a>).</p>
123123
</div>

docs/text/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Contribute to the software
3030
#. **pushd docs & make html** (this generates the documentation, and might rise issues that need to be fixed before the pull request; if the build succeeds and if the contribution changes the documentation, then copy all content from the docs/_build/html/ folder and replace the files in the `docs <https://github.com/cssr-tools/pycopm/tree/main/docs>`_ folder)
3131

3232
.. tip::
33-
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 24.04 using Python 3.12.
33+
See the `ci_pycopm_ubuntu.yml <https://github.com/cssr-tools/pycopm/blob/main/.github/workflows/ci_pycopm_ubuntu.yml>`_ script and the `Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (binary packages), and dependencies, as well as the execution of the seven previous steps in Ubuntu 26.04 using Python 3.14.
3434
For macOS users, see the `ci_pycopm_macos.yml <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml>`_ script and the `OPM-Flow_macOS Actions <https://github.com/cssr-tools/pycopm/actions>`_ for installation of pycopm, OPM Flow (source build), and dependencies, as well as running the tests and the hello world example in macOS 26 using Python3.14.
3535
Note that if you do not add the directory containing the OPM Flow executable to your system's PATH environment variable (e.g., export PATH=$PATH:/Users/yourname/pycopm/build/opm-simulators/bin), then you can pass this in the execution of the tests and pycopm using the flags **-f/\-\-flow** (see `this script <https://github.com/daavid00/OPM-Flow_macOS/blob/main/.github/workflows/ci_pycopm_macos.yml#L72>`_).
3636

0 commit comments

Comments
 (0)