Merge pull request #67 from daavid00/dev #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run pycopm in Ubuntu | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| run-pycopm-local: | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.11'] | |
| os: [ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Flow Simulator | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install software-properties-common | |
| sudo apt-add-repository ppa:opm/ppa | |
| sudo apt-get update | |
| sudo apt-get install mpi-default-bin | |
| sudo apt-get install libopm-simulators-bin | |
| - name: Install ert dependency | |
| run: | | |
| sudo apt-get install freeglut3-dev | |
| - name: Install dependecies | |
| run: | | |
| pip install --upgrade pip setuptools wheel | |
| pip install -r dev-requirements.txt | |
| - name: Install pycopm | |
| run: | | |
| pip install -e . | |
| - name: Check code style and linting | |
| run: | | |
| black --check src/ tests/ | |
| pylint src/ tests/ | |
| mypy --ignore-missing-imports src/ tests/ | |
| - name: Run tests | |
| run: | | |
| pytest --cov=pycopm --cov-report term-missing tests/ | |
| - name: Run hello world example | |
| run: | | |
| pycopm -i examples/decks/HELLO_WORLD.DATA -c 5,5,1 -m all -o output | |
| - name: Check if hello world example succeded | |
| run: | | |
| file="/home/runner/work/pycopm/pycopm/output/HELLO_WORLD_PYCOPM.EGRID" | |
| if [[ -f "$file" ]]; then | |
| echo "pycopm succeeded" | |
| else | |
| echo "pycopm failed" | |
| exit 1 | |
| fi | |
| - name: Build documentation | |
| run: | | |
| pushd docs | |
| make html |