forked from equinor/fmu-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (104 loc) · 3.52 KB
/
fmu-tools.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: fmu-tools
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
schedule:
# Run CI every night and check that tests are working with latest dependencies
- cron: "0 0 * * *"
jobs:
fmu-tools:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# 1.1.3 for Python 3.8 in RMS up to 14.2
# 1.5.3 for Komodo
pandas-version: ["1.1.3", "1.5.3", "2.0.2", "2.*"]
exclude:
- python-version: "3.12"
pandas-version: "1.1.3"
- python-version: "3.12"
pandas-version: "1.5.3"
# No built wheel released for 2.0.2
- python-version: "3.12"
pandas-version: "2.0.2"
- python-version: "3.11"
pandas-version: "1.1.3"
- python-version: "3.11"
pandas-version: "1.5.3"
- python-version: "3.10"
pandas-version: "1.1.3"
- python-version: "3.10"
pandas-version: "1.5.3"
- python-version: "3.9"
pandas-version: "1.1.3"
- python-version: "3.9"
pandas-version: "1.5.3"
steps:
- name: Checkout
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 requirements
if: ${{ always() }}
run: |
pip install -U pip
pip install .[docs,tests]
pip install pandas==${{ matrix.pandas-version }}
- name: List all installed packages
if: ${{ always() }}
run: pip freeze
- name: Ruff check
if: ${{ always() }}
run: ruff check .
- name: Ruff format check
if: ${{ always() }}
run: ruff format . --check
- name: Enforce static typing
if: ${{ always() }}
run: mypy src/fmu/tools
- name: Run tests
if: ${{ always() }}
run: |
git clone --depth 1 https://github.com/equinor/xtgeo-testdata ../xtgeo-testdata
pytest -n auto tests --disable-warnings
- name: Syntax check on documentation
if: ${{ always() }}
run: rstcheck -r docs
- name: Build documentation
if: ${{ always() }}
run: |
sphinx-apidoc -f -H "API for fmu.tools" -o docs src
sphinx-build -W -b html docs build/docs/html
- name: Update GitHub pages
if: |
github.repository_owner == 'equinor' && github.ref == 'refs/heads/main' &&
matrix.python-version == '3.8' && matrix.pandas-version == '1.1.3'
run: |
cp -R ./build/docs/html ../html
git config --local user.email "fmu-tools-github-action"
git config --local user.name "fmu-tools-github-action"
git fetch origin gh-pages
git checkout --track origin/gh-pages
git clean -f -f -d -x # Double -f is intentional.
git rm -r *
cp -R ../html/* .
touch .nojekyll # If not, github pages ignores _* directories.
git add .
if git diff-index --quiet HEAD; then
echo "No changes in documentation. Skip documentation deploy."
else
git commit -m "Update Github Pages"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
fi