Merge pull request #15 from Ai33L/develop #200
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python package | |
on: | |
push: | |
branches: [ stable] | |
pull_request: | |
branches: [ stable, develop ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04, macos-11] | |
python-version: [py38, py39, py310] | |
# python-version: [py37, py38] | |
steps: | |
- uses: actions/checkout@v2 | |
# - name: Set up Python 37 | |
# if: ${{ matrix.python-version == 'py37' }} | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: "3.7" | |
- name: Set up Python 38 | |
if: ${{ matrix.python-version == 'py38' }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.8" | |
- name: Set up Python 39 | |
if: ${{ matrix.python-version == 'py39' }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.9" | |
- name: Set up Python 310 | |
if: ${{ matrix.python-version == 'py310' }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install wheel tox | |
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 --ignore=E501,E226,W504,W605 gfs_dynamical_core/ --count --show-source --statistics | |
- name: Build gfs | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
gfortran --version | |
CLIMT_ARCH=Linux tox -e ${{ matrix.python-version }} | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
# which gcc #/usr/bin/gcc | |
# which gfortran | |
CLIMT_ARCH=Darwin tox -e ${{ matrix.python-version }} | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
shell: bash |