66 pull_request :
77 branches :
88 - " *"
9+ workflow_dispatch :
10+
11+ concurrency :
12+ group : ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }}
13+ cancel-in-progress : ${{github.event_name == 'pull_request'}}
914
1015jobs :
11- setup_install :
12- name : Run setup install
16+ pre-commit :
17+ name : pre-commit checks
1318 runs-on : ubuntu-latest
14- container :
15- image : precice/precice:nightly
16- options : --user root
1719 steps :
18- - name : Checkout Repository
19- uses : actions/checkout@v2
20- - name : Install pip3, pkgconfig and upgrade pip3
21- run : |
22- apt-get -yy update
23- apt-get install -y python3-pip python3.12-venv pkg-config
24- rm -rf /var/lib/apt/lists/*
25- - name : Create venv
26- run : python3 -m venv .venv
27- - name : Activate venv
28- # see https://stackoverflow.com/a/74669486
29- run : |
30- . .venv/bin/activate
31- echo PATH=$PATH >> $GITHUB_ENV
32- - name : Install dependencies
33- run : |
34- pip3 install toml
35- python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin
36- - name : Run setup install
37- run : python3 setup.py install
38- - name : Test install
39- run : |
40- export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
41- python3 -c "import precice"
20+ - uses : actions/checkout@v4
21+ - name : Setup python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : ' 3.x'
25+ - name : Run pre-commit
26+ uses : pre-commit/action@v3.0.1
4227
43- setup_test :
44- name : Run setup test
28+ run_tox :
29+ name : mocked tests
30+ needs : [pre-commit]
4531 runs-on : ubuntu-latest
4632 steps :
4733 - name : Checkout Repository
5238 sudo apt-get -yy update
5339 sudo apt-get install -y libopenmpi-dev cmake libboost-all-dev libeigen3-dev pkg-config
5440 sudo rm -rf /var/lib/apt/lists/*
55- - uses : BSFishy/pip-action@v1
56- with :
57- packages : toml
5841 - name : Checkout precice and make required files discoverable
5942 run : |
6043 git clone --branch develop https://github.com/precice/precice.git precice-core
@@ -65,27 +48,56 @@ jobs:
6548 cd precice-core
6649 mkdir build && cd build
6750 cmake .. -DPRECICE_FEATURE_MPI_COMMUNICATION=OFF -DPRECICE_FEATURE_PETSC_MAPPING=OFF -DPRECICE_FEATURE_PYTHON_ACTIONS=OFF -DBUILD_TESTING=OFF
68- - name : Install dependencies
69- run : |
70- python3 -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | pip3 install -r /dev/stdin
71- - name : Run setup test
51+ - name : Install tox
52+ run : pip install tox
53+ - name : Run tox
7254 env :
73- PKG_CONFIG_PATH : " precice-core/build"
7455 PKG_CONFIG_SYSTEM_INCLUDE_PATH : 1
7556 run : |
76- export CFLAGS=-I$GITHUB_WORKSPACE
77- python3 setup.py test
57+ export PKG_CONFIG_PATH=$(readlink -f "precice-core/build")
58+ tox
59+
60+ build_dist :
61+ name : build distributions
62+ needs : [pre-commit]
63+ runs-on : ubuntu-latest
64+ container :
65+ image : precice/precice:nightly
66+ options : --user root
67+ steps :
68+ - name : Checkout Repository
69+ uses : actions/checkout@v4
70+ with :
71+ fetch-depth : 0
72+ - name : Configure safe directory
73+ run : git config --global --add safe.directory $GITHUB_WORKSPACE
74+ - name : Install dependencies
75+ run : |
76+ apt-get -yy update
77+ apt-get install -y python3-pip python3.12-venv pkg-config pipx
78+ rm -rf /var/lib/apt/lists/*
79+ - name : Install pyproject-build
80+ run : |
81+ pipx install build
82+ - name : Build sdist
83+ run : |
84+ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
85+ $HOME/.local/bin/pyproject-build -s
86+ - name : Build wheel
87+ run : |
88+ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
89+ $HOME/.local/bin/pyproject-build -w
7890
7991 pip_install :
80- name : Run pip install
81- needs : [setup_test ]
92+ name : pip install
93+ needs : [pre-commit ]
8294 runs-on : ubuntu-latest
8395 container :
8496 image : precice/precice:nightly
8597 options : --user root
8698 steps :
8799 - name : Checkout Repository
88- uses : actions/checkout@v2
100+ uses : actions/checkout@v4
89101 - name : Install dependencies
90102 run : |
91103 apt-get -yy update
@@ -94,28 +106,30 @@ jobs:
94106 - name : Create venv
95107 run : |
96108 python3 -m venv .venv
97- - name : Activate venv
98- # see https://stackoverflow.com/a/74669486
99- run : |
100- . .venv/bin/activate
101- echo PATH=$PATH >> $GITHUB_ENV
102109 - name : Run pip install
103- run : pip3 install .
110+ run : |
111+ .venv/bin/pip3 install .
104112 - name : Check import
105113 run : |
106114 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
107- python3 -c "import precice"
115+ .venv/bin/python3 -c "import precice"
116+ - name : Get version
117+ run : |
118+ export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
119+ .venv/bin/python3 -c "import precice; print(precice.__version__)"
120+ .venv/bin/python3 -c "import precice; print(precice.get_version_information())"
121+
108122
109123 solverdummy_test :
110- name : Run solverdummy
124+ name : solverdummies
111125 needs : [pip_install]
112126 runs-on : ubuntu-latest
113127 container :
114128 image : precice/precice:nightly
115129 options : --user root
116130 steps :
117131 - name : Checkout Repository
118- uses : actions/checkout@v2
132+ uses : actions/checkout@v4
119133 - name : Install dependencies
120134 run : |
121135 apt-get -yy update
0 commit comments