CI #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # Daily “At 00:00” | |
jobs: | |
test: | |
name: Python (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ "ubuntu-latest", "macos-latest", "macos-14" ] | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ github.token }} | |
- name: Conda setup | |
uses: conda-incubator/setup-miniconda@v3 | |
if: matrix.os != 'macos-14' | |
with: | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
environment-file: build_envs/environment.yml | |
- name: Conda setup (macOS M1) | |
uses: conda-incubator/setup-miniconda@v3 | |
if: matrix.os == 'macos-14' | |
with: | |
installer-url: https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-MacOSX-arm64.sh | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
environment-file: build_envs/environment.yml | |
- name: Build WRF-Python | |
run: | | |
python -m pip install build | |
python -m build . | |
python -m pip install dist/wrf*.whl | |
- name: Check import | |
run: | | |
python -m pip show wrf-python | |
python -m pip show --files wrf-python | |
prefix="$(python -m pip show --files six | grep Location: | cut -f2 -d' ')" | |
installed_files="$(python -m pip show --files wrf-python | sed -E -e "/\\w+:/ d" -e "/^\s+/ s|^ |${prefix}/|g")" | |
ls -l ${installed_files} | |
file ${installed_files} | |
ldd ${installed_files} | |
python -vvv -d -c "import wrf" | |
- name: Run tests | |
run: | | |
cd test/ci_tests | |
python utests.py |