Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/GitHub actions #11

Merged
merged 14 commits into from
Nov 2, 2023
57 changes: 57 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and test fmu-sumo-uploader

on:
pull_request:
branches: [main]
schedule:
- cron: "5 5 * * *"

jobs:
build_pywheels:
name: PY ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
os: [ubuntu-latest]
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v3

- name: Azure Login
uses: Azure/login@v1
with:
client-id: f96c150d-cacf-4257-9cc9-54b2c68ec4ce
tenant-id: 3aa4a235-b6e2-48d5-9195-7fcf05b459b0
subscription-id: 87897772-fb27-495f-ae40-486a2df57baa

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install fmu-sumo-sim2sumo
run: |
python -m pip install --upgrade pip
python -m pip install opm
python -m pip install git+https://github.com/equinor/fmu-sumo-uploader.git@main
python -m pip install git+https://github.com/equinor/fmu-dataio.git@main
python -m pip install pytest
python -m pip install pytest-timeout
python -m pip install .
- name: Run tests
shell: bash
run: |
az --version
az account list
pip show sumo-wrapper-python
pip show fmu-sumo-uploader
python -c 'import sys; print(sys.platform)'
python -c 'import os; import sys; print(os.path.dirname(sys.executable))'
access_token=$(az account get-access-token --scope api://88d2b022-3539-4dda-9e66-853801334a86/.default --query accessToken --output tsv)
export ACCESS_TOKEN=$access_token

pytest -s -v --timeout=300
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ python_requires = >=3.8
install_requires =
urllib3 <2.0
ert
opm
ecl2df
fmu-sumo-uploader
fmu-dataio
Expand Down
4 changes: 1 addition & 3 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
def test_submodules_dict():
"""Test generation of submodule list"""
sublist, submods = _define_submodules()
print(sublist, submods)
LOGGER.info(submods)
assert isinstance(sublist, tuple)
assert isinstance(submods, dict)
Expand Down Expand Up @@ -126,7 +125,7 @@ def test_export_results_w_options(tmp_path, submod="summary"):
CHECK_DICT = {
"global_variables_w_eclpath.yml": {
"nrdatafile": 1,
"nrsubmods": 17,
"nrsubmods": 3,
"nroptions": 1,
"arrow": True,
},
Expand Down Expand Up @@ -257,7 +256,6 @@ def test_convert_to_arrow():
}
)
dframe["DATE"] = dframe["DATE"].astype("datetime64[ms]")
print(dframe.dtypes)
table = convert_to_arrow(dframe)
assert isinstance(table, pa.Table), "Did not convert to table"

Expand Down