Skip to content

Commit 309b831

Browse files
authored
Merge pull request #101 from ecmwf/feature/master-to-develop
Merge master into develop
2 parents b0bc302 + 540750e commit 309b831

26 files changed

+1147
-13
lines changed
+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# (C) Copyright 2024- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
9+
10+
name: Build Linux
11+
12+
on:
13+
# Trigger the workflow manually
14+
workflow_dispatch: ~
15+
16+
# Allow to be called from another workflow
17+
workflow_call: ~
18+
19+
# repository_dispatch:
20+
# types: [eccodes-updated]
21+
22+
push:
23+
paths:
24+
- 'scripts/common.sh'
25+
- 'scripts/select-python-linux.sh'
26+
- 'scripts/wheel-linux.sh'
27+
- 'scripts/build-linux.sh'
28+
- 'scripts/test-linux.sh'
29+
- 'scripts/copy-licences.py'
30+
- '.github/workflows/build-wheel-linux.yml'
31+
32+
# to allow the action to run on the manylinux docker image based on CentOS 7
33+
env:
34+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
35+
36+
jobs:
37+
38+
build:
39+
40+
# if: false # for temporarily disabling for debugging
41+
42+
runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
43+
container: dockcross/manylinux2014-x64:latest
44+
45+
name: Build manylinux2014
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
50+
- run: ./scripts/build-linux.sh
51+
52+
################################################################
53+
- run: ./scripts/wheel-linux.sh 3.8
54+
- uses: actions/upload-artifact@v3
55+
name: Upload wheel 3.8
56+
with:
57+
name: wheel-manylinux2014-3.8
58+
path: wheelhouse/*.whl
59+
60+
# ################################################################
61+
- run: ./scripts/wheel-linux.sh 3.9
62+
- uses: actions/upload-artifact@v3
63+
name: Upload wheel 3.9
64+
with:
65+
name: wheel-manylinux2014-3.9
66+
path: wheelhouse/*.whl
67+
68+
# ################################################################
69+
- run: ./scripts/wheel-linux.sh 3.10
70+
- uses: actions/upload-artifact@v3
71+
name: Upload wheel 3.10
72+
with:
73+
name: wheel-manylinux2014-3.10
74+
path: wheelhouse/*.whl
75+
76+
# ################################################################
77+
- run: ./scripts/wheel-linux.sh 3.11
78+
- uses: actions/upload-artifact@v3
79+
name: Upload wheel 3.11
80+
with:
81+
name: wheel-manylinux2014-3.11
82+
path: wheelhouse/*.whl
83+
84+
# ################################################################
85+
- run: ./scripts/wheel-linux.sh 3.12
86+
- uses: actions/upload-artifact@v3
87+
name: Upload wheel 3.12
88+
with:
89+
name: wheel-manylinux2014-3.12
90+
path: wheelhouse/*.whl
91+
92+
test:
93+
94+
needs: build
95+
96+
strategy:
97+
fail-fast: false
98+
matrix: # We don't test 3.6, as it is not supported anymore by github actions
99+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
100+
101+
runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
102+
103+
name: Test with ${{ matrix.python-version }}
104+
105+
steps:
106+
107+
- uses: actions/checkout@v2
108+
109+
- uses: actions/download-artifact@v3
110+
with:
111+
name: wheel-manylinux2014-${{ matrix.python-version }}
112+
113+
- run: ./scripts/test-linux.sh ${{ matrix.python-version }}
114+
115+
116+
deploy:
117+
118+
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' }}
119+
120+
strategy:
121+
fail-fast: false
122+
matrix:
123+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
124+
125+
needs: [test, build]
126+
127+
name: Deploy wheel ${{ matrix.python-version }}
128+
129+
runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
130+
131+
132+
steps:
133+
134+
- run: mkdir artifact-${{ matrix.python-version }}
135+
136+
- uses: actions/checkout@v2
137+
138+
- uses: actions/download-artifact@v3
139+
with:
140+
name: wheel-manylinux2014-${{ matrix.python-version }}
141+
path: artifact-${{ matrix.python-version }}
142+
143+
- run: |
144+
source ./scripts/select-python-linux.sh 3.10
145+
pip3 install twine
146+
ls -l artifact-${{ matrix.python-version }}/*.whl
147+
twine upload artifact-${{ matrix.python-version }}/*.whl
148+
env:
149+
TWINE_USERNAME: __token__
150+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
+155
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# (C) Copyright 2024- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
9+
name: Build MacOS ARM
10+
11+
on:
12+
# Trigger the workflow manually
13+
workflow_dispatch: ~
14+
15+
# allow to be called from another workflow
16+
workflow_call: ~
17+
18+
# repository_dispatch:
19+
# types: [eccodes-updated]
20+
21+
push:
22+
paths:
23+
- 'scripts/common.sh'
24+
- 'scripts/select-python-macos.sh'
25+
- 'scripts/build-macos.sh'
26+
- 'scripts/wheel-macos.sh'
27+
- 'scripts/test-macos.sh'
28+
- 'scripts/copy-licences.py'
29+
- '.github/workflows/build-wheel-macos.yml'
30+
31+
# We don't use "actions/setup-python@v4" as it installs a universal python
32+
# which creates universal wheels. We want to create wheels for the specific
33+
# architecture we are running on.
34+
35+
jobs:
36+
37+
build:
38+
39+
# if: false # for temporarily disabling for debugging
40+
41+
strategy:
42+
matrix:
43+
arch_type: [ARM64, X64]
44+
runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
45+
46+
name: Build
47+
48+
steps:
49+
50+
- run: sudo mkdir -p /Users/runner
51+
- run: sudo chown administrator:staff /Users/runner
52+
53+
- uses: actions/checkout@v2
54+
55+
- run: ./scripts/build-macos.sh "3.10"
56+
57+
- run: ./scripts/wheel-macos.sh "3.9"
58+
- run: ls -l wheelhouse
59+
- uses: actions/upload-artifact@v4
60+
name: Upload wheel 3.9 ${{ matrix.arch_type }}
61+
with:
62+
name: wheel-macos-${{ matrix.arch_type }}-3.9
63+
path: wheelhouse/*.whl
64+
- run: rm -fr wheelhouse
65+
66+
- run: ./scripts/wheel-macos.sh "3.10"
67+
- run: ls -l wheelhouse
68+
- uses: actions/upload-artifact@v4
69+
name: Upload wheel 3.10 ${{ matrix.arch_type }}
70+
with:
71+
name: wheel-macos-${{ matrix.arch_type }}-3.10
72+
path: wheelhouse/*.whl
73+
- run: rm -fr wheelhouse
74+
75+
- run: ./scripts/wheel-macos.sh "3.11"
76+
- run: ls -l wheelhouse
77+
- uses: actions/upload-artifact@v4
78+
name: Upload wheel 3.11 ${{ matrix.arch_type }}
79+
with:
80+
name: wheel-macos-${{ matrix.arch_type }}-3.11
81+
path: wheelhouse/*.whl
82+
- run: rm -fr wheelhouse
83+
84+
- run: ./scripts/wheel-macos.sh "3.12"
85+
- run: ls -l wheelhouse
86+
- uses: actions/upload-artifact@v4
87+
name: Upload wheel 3.12 ${{ matrix.arch_type }}
88+
with:
89+
name: wheel-macos-${{ matrix.arch_type }}-3.12
90+
path: wheelhouse/*.whl
91+
- run: rm -fr wheelhouse
92+
93+
test:
94+
needs: build
95+
96+
strategy:
97+
fail-fast: true
98+
max-parallel: 1
99+
matrix:
100+
arch_type: [ARM64, X64]
101+
python-version: ["3.9", "3.10", "3.11", "3.12"]
102+
103+
runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
104+
105+
name: Test with Python ${{ matrix.python-version }} ${{ matrix.arch_type }}
106+
107+
steps:
108+
109+
- uses: actions/checkout@v2
110+
111+
- uses: actions/download-artifact@v4
112+
with:
113+
name: wheel-macos-${{ matrix.arch_type }}-${{ matrix.python-version }}
114+
115+
- run: ./scripts/test-macos.sh ${{ matrix.python-version }}
116+
117+
118+
deploy:
119+
120+
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' }}
121+
122+
needs: [test, build]
123+
124+
name: Deploy wheel ${{ matrix.python-version }} ${{ matrix.arch_type }}
125+
126+
strategy:
127+
fail-fast: true
128+
max-parallel: 1
129+
matrix:
130+
arch_type: [ARM64, X64]
131+
python-version: ["3.9", "3.10", "3.11", "3.12"]
132+
133+
runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
134+
135+
steps:
136+
137+
- run: mkdir artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}
138+
139+
- uses: actions/download-artifact@v4
140+
with:
141+
name: wheel-macos-${{ matrix.arch_type }}-${{ matrix.python-version }}
142+
path: artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}
143+
144+
- run: |
145+
source ./scripts/select-python-macos.sh ${{ matrix.python-version }}
146+
VENV_DIR=./dist_venv_${{ matrix.python-version }}
147+
rm -rf ${VENV_DIR}
148+
python3 -m venv ${VENV_DIR}
149+
source ${VENV_DIR}/bin/activate
150+
pip3 install twine
151+
ls -l artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}/*.whl
152+
twine upload artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}/*.whl
153+
env:
154+
TWINE_USERNAME: __token__
155+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/cd.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1+
# (C) Copyright 2024- ECMWF.
2+
#
3+
# This software is licensed under the terms of the Apache Licence Version 2.0
4+
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5+
# In applying this licence, ECMWF does not waive the privileges and immunities
6+
# granted to it by virtue of its status as an intergovernmental organisation
7+
# nor does it submit to any jurisdiction.
8+
19
name: cd
210

311
on:
12+
# Trigger the workflow manually
13+
workflow_dispatch: ~
14+
415
push:
516
tags:
617
- '**'
7-
18+
paths:
19+
- '.github/workflows/cd.yml'
820
jobs:
21+
wheel-linux:
22+
uses: ./.github/workflows/build-wheel-linux.yml
23+
secrets: inherit
24+
wheel-macos:
25+
uses: ./.github/workflows/build-wheel-macos.yml
26+
secrets: inherit
927
pypi:
28+
needs: [wheel-linux, wheel-macos]
1029
uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2
1130
secrets: inherit
31+

.github/workflows/check-and-publish.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,19 @@ jobs:
7474
- run: pip install -r tests/requirements.txt
7575
- run: pip freeze
7676
- run: env | sort
77-
- run: python -m eccodes selfcheck
77+
- run: ECCODES_PYTHON_USE_FINDLIBS=1 python -m eccodes selfcheck
7878

7979
- run: pytest
8080
if: matrix.method == 'conda' && matrix.platform == 'windows-latest'
8181
env:
8282
ECCODES_DEFINITION_PATH: 'C:/Miniconda/Library/share/eccodes/definitions'
8383
ECCODES_SAMPLES_PATH: 'C:/Miniconda/Library/share/eccodes/samples'
84+
ECCODES_PYTHON_USE_FINDLIBS: '1'
8485

8586
- run: pytest
8687
if: matrix.method != 'conda' || matrix.platform != 'windows-latest'
87-
88+
env:
89+
ECCODES_PYTHON_USE_FINDLIBS: '1'
8890
# pytest -v --cov=. --cov-report=xml --cov-branch .
8991

9092
- name: Upload coverage to Codecov

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- "develop"
99
tags-ignore:
1010
- "**"
11+
paths-ignore:
12+
- "scripts/**"
13+
- ".github/workflows/*wheel*.yml"
14+
- ".github/workflows/cd.yml"
1115

1216
# Trigger the workflow on pull request
1317
pull_request: ~

0 commit comments

Comments
 (0)