Skip to content

Commit b439dce

Browse files
authored
GitHub Actions workflow updates (#267)
* Update ci.yml * Update pypi.yaml
1 parent ee3edc9 commit b439dce

File tree

2 files changed

+19
-34
lines changed

2 files changed

+19
-34
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,41 @@ on:
99
schedule:
1010
- cron: '0 0 * * *' # Daily “At 00:00”
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
test:
14-
name: Python (${{ matrix.python-version }}, ${{ matrix.os }})
18+
name: Python ${{ matrix.python-version }}, ${{ matrix.os }}
1519
runs-on: ${{ matrix.os }}
1620
defaults:
1721
run:
1822
shell: bash -l {0}
19-
2023
strategy:
2124
fail-fast: false
2225
matrix:
2326
os: [ "ubuntu-latest", "macos-latest", "macos-14" ]
2427
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
25-
2628
steps:
27-
- name: Cancel previous runs
28-
uses: styfle/[email protected]
29-
with:
30-
access_token: ${{ github.token }}
31-
- name: Checkout
29+
- name: checkout
3230
uses: actions/checkout@v4
31+
- name: environment setup
32+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1
3333
with:
34-
token: ${{ github.token }}
35-
- name: Conda setup
36-
uses: conda-incubator/setup-miniconda@v3
37-
if: matrix.os != 'macos-14'
38-
with:
39-
python-version: ${{ matrix.python-version }}
40-
channels: conda-forge
41-
environment-file: build_envs/environment.yml
42-
- name: Conda setup (macOS M1)
43-
uses: conda-incubator/setup-miniconda@v3
44-
if: matrix.os == 'macos-14'
45-
with:
46-
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh
4734
python-version: ${{ matrix.python-version }}
4835
channels: conda-forge
4936
environment-file: build_envs/environment.yml
50-
- name: Build WRF-Python
37+
- name: build WRF-Python
5138
run: |
5239
python -m pip install build
5340
python -m build .
5441
python -m pip install dist/wrf*.whl
55-
- name: Run tests
42+
- name: run tests
5643
run: |
5744
cd test/ci_tests
5845
python utests.py
59-
- name: Check import
46+
- name: check import
6047
if: failure()
6148
run: |
6249
python -m pip show wrf-python

.github/workflows/pypi.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ jobs:
1212
- name: Set up Python
1313
uses: actions/setup-python@v5
1414
with:
15-
python-version: '3.x'
15+
python-version: '3.10'
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
python -m pip install setuptools setuptools-scm wheel twine check-manifest
19+
python -m pip install build twine
2020
- name: Build tarball and wheels
2121
run: |
22-
python setup.py sdist bdist_wheel
23-
python -m pip wheel . -w dist --no-deps
22+
python -m build
2423
- name: Test the artifacts
2524
run: |
2625
python -m twine check dist/*
@@ -33,22 +32,21 @@ jobs:
3332
- name: Set up Python
3433
uses: actions/setup-python@v5
3534
with:
36-
python-version: '3.x'
35+
python-version: '3.10'
3736
- name: Install dependencies
3837
run: |
3938
python -m pip install --upgrade pip
40-
python -m pip install setuptools setuptools-scm wheel twine check-manifest
39+
python -m pip install build twine
4140
- name: Build tarball and wheels
4241
run: |
43-
python setup.py sdist bdist_wheel
44-
python -m pip wheel . -w dist --no-deps
42+
python -m build
4543
- name: Test the artifacts
4644
run: |
4745
python -m twine check dist/*
4846
- name: Publish package to PyPI
49-
uses: pypa/[email protected]
47+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
5048
with:
5149
user: __token__
5250
password: ${{ secrets.PYPI_WRF_PYTHON }}
5351
skip_existing: true
54-
verbose: true
52+
verbose: true

0 commit comments

Comments
 (0)