From 4edbd740eca0be89ac05b45c197c8bf2da443024 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Fri, 29 Jan 2021 16:43:15 -0700 Subject: [PATCH 1/8] Set up skeleton CI action --- .github/workflows/build-test-ci.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-test-ci.yml diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml new file mode 100644 index 00000000..e06931ce --- /dev/null +++ b/.github/workflows/build-test-ci.yml @@ -0,0 +1,61 @@ +name: Build/Test CI + +on: [push, pull_request] + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash -l {0} + + strategy: + matrix: + os: [ubuntu-latest] + python-version: [3.8] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Show submodule listings + run: | + ls -1 -F external/bmi-example-c + ls -1 -F external/bmi-example-cxx + ls -1 -F external/bmi-example-fortran + ls -1 -F external/bmi-example-python + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Lint + run: | + pip install flake8 + make lint + + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Build docs + run: | + pip install -r requirements.txt -r requirements-docs.txt + pip install -e . + make -C docs clean html From 1e30ecbcb9baf353c6782c04da1ddc268cc13709 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Fri, 29 Jan 2021 21:27:02 -0700 Subject: [PATCH 2/8] Try mamba --- .github/workflows/build-test-ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index e06931ce..dd7597ff 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -20,12 +20,20 @@ jobs: with: submodules: true - - name: Show submodule listings + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + mamba-version: "*" + channels: conda-forge + channel-priority: true + + - name: Install dependencies run: | - ls -1 -F external/bmi-example-c - ls -1 -F external/bmi-example-cxx - ls -1 -F external/bmi-example-fortran - ls -1 -F external/bmi-example-python + mamba install --file=requirements.txt --file=requirements-testing.txt + conda list + + lint: runs-on: ubuntu-latest From e534a521ad1309d18160a8ecaccce8f2e44b4103 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Fri, 29 Jan 2021 21:35:16 -0700 Subject: [PATCH 3/8] Build babelizer and show diagnostics --- .github/workflows/build-test-ci.yml | 41 +++++++---------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index dd7597ff..833160e6 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -33,37 +33,16 @@ jobs: mamba install --file=requirements.txt --file=requirements-testing.txt conda list - - - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Lint + - name: Install babelizer run: | - pip install flake8 - make lint - - docs: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 + pip install . - - name: Build docs + - name: Diagnostics run: | - pip install -r requirements.txt -r requirements-docs.txt - pip install -e . - make -C docs clean html + babelize --version + babelize --help + babelize init --help + babelize update --help + babelize generate --help + babelize generate - --no-input + python -c 'import babelizer; print(babelizer.__version__)' From b6a16d9834afb5ce2decae78099cb70c26f85506 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 1 Feb 2021 10:26:50 -0700 Subject: [PATCH 4/8] Make C example --- .github/workflows/build-test-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index 833160e6..f539a4f3 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -46,3 +46,11 @@ jobs: babelize generate --help babelize generate - --no-input python -c 'import babelizer; print(babelizer.__version__)' + + - name: Make C example + run: | + mkdir buildc && pushd buildc + echo $CONDA_PREFIX + cmake ../external/bmi-example-c -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + make install + popd From 1333bc647121f64deb44e851f2adc96288fcf267 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 1 Feb 2021 10:36:01 -0700 Subject: [PATCH 5/8] Test language examples --- .github/workflows/build-test-ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index f539a4f3..ca551828 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -50,7 +50,30 @@ jobs: - name: Make C example run: | mkdir buildc && pushd buildc - echo $CONDA_PREFIX cmake ../external/bmi-example-c -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX make install popd + + - name: Make C++ example + run: | + mkdir buildcxx && pushd buildcxx + cmake ../external/bmi-example-cxx -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + make install + popd + + - name: Make Fortran example + run: | + mkdir buildf && pushd buildf + cmake ../external/bmi-example-fortran -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + make install + popd + + - name: Make Python example + run: | + pushd ./external/bmi-example-python + make install + popd + + - name: Test language examples + run: | + pytest -vvv From f06b94a68d2a6ff01d8b58cb668a6f68b1d60bdd Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 1 Feb 2021 10:52:16 -0700 Subject: [PATCH 6/8] Extend tests to macOS and py39 --- .github/workflows/build-test-ci.yml | 39 ++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-ci.yml b/.github/workflows/build-test-ci.yml index ca551828..9237af12 100644 --- a/.github/workflows/build-test-ci.yml +++ b/.github/workflows/build-test-ci.yml @@ -12,8 +12,8 @@ jobs: strategy: matrix: - os: [ubuntu-latest] - python-version: [3.8] + os: [ubuntu-latest, macos-latest] + python-version: [3.8, 3.9] steps: - uses: actions/checkout@v2 @@ -37,7 +37,7 @@ jobs: run: | pip install . - - name: Diagnostics + - name: Run diagnostics run: | babelize --version babelize --help @@ -77,3 +77,36 @@ jobs: - name: Test language examples run: | pytest -vvv + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Lint + run: | + pip install flake8 + make lint + + docs: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Build docs + run: | + pip install -r requirements.txt -r requirements-docs.txt + pip install -e . + make -C docs clean html From eb90222cc23e09440c725d223494a9f829470b8e Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 1 Feb 2021 11:27:29 -0700 Subject: [PATCH 7/8] Replace references to Travis CI --- .travis.yml | 83 ------------------------------------------------ CONTRIBUTING.rst | 2 +- README.rst | 4 +-- 3 files changed, 3 insertions(+), 86 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e8767ed5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,83 +0,0 @@ -language: generic -os: -- linux -- osx -env: - matrix: - - PYTHON="3.8" - - PYTHON="3.9" -sudo: false - -jobs: - include: - - stage: lint - os: linux - script: - - pip install flake8 - - make lint - - - stage: docs - os: linux - install: - - pip install -r requirements-docs.txt - - pip install -e . - script: - - make -C docs clean html - -before_install: -- | - if [[ $TRAVIS_OS_NAME == "osx" ]]; then - brew remove --force $(brew list) - brew cleanup -s - rm -rf $(brew --cache) - fi -- | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - curl -L https://micromamba.snakepit.net/api/micromamba/osx-64/latest | tar -xvj bin/micromamba - else - curl -L https://micromamba.snakepit.net/api/micromamba/linux-64/latest | tar -xvj bin/micromamba - fi -- ./bin/micromamba shell init -s bash -p ~/micromamba -- | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - source $HOME/.bash_profile - else - source $HOME/.bashrc - fi -- micromamba activate -- micromamba install mamba --yes -c conda-forge -p $MAMBA_ROOT_PREFIX -- mamba create -n testing python=$PYTHON --file=requirements-testing.txt --yes -c conda-forge -- source activate testing -- | - mkdir _build \ - && pushd _build \ - && cmake ../external/bmi-example-c -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - && make install \ - && popd -- | - mkdir _buildf \ - && pushd _buildf \ - && cmake ../external/bmi-example-fortran -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - && make install \ - && popd -- | - mkdir _buildcxx \ - && pushd _buildcxx \ - && cmake ../external/bmi-example-cxx -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - && make install \ - && popd -- | - pushd ./external/bmi-example-python \ - && make install \ - && popd -install: -- pip install . -script: -- babelize --version -- babelize --help -- babelize init --help -- babelize update --help -- babelize generate --help -- babelize generate - --no-input -- python -c 'import babelizer; print(babelizer.__version__)' -- pytest -vvv diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 09d870ee..49dac42f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -106,7 +106,7 @@ Before you submit a pull request, check that it meets these guidelines: your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request need only work with Python >= 3.8. Check - https://travis-ci.org/csdms/babelizer/pull_requests + https://github.com/csdms/babelizer/actions and make sure that the tests pass. Deploying diff --git a/README.rst b/README.rst index 8b12f7c6..d9063635 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -.. image:: https://travis-ci.com/csdms/babelizer.svg?branch=develop - :target: https://travis-ci.com/csdms/babelizer +.. image:: https://github.com/csdms/babelizer/workflows/Build/Test%20CI/badge.svg + :target: https://github.com/csdms/babelizer/actions?query=workflow%3A%22Build%2FTest+CI%22 .. image:: https://readthedocs.org/projects/babelizer/badge/?version=latest :target: https://babelizer.readthedocs.io/en/latest/?badge=latest From 748443ce332808a0a2f223a169e0bad621eee7d0 Mon Sep 17 00:00:00 2001 From: Mark Piper Date: Mon, 1 Feb 2021 13:28:12 -0700 Subject: [PATCH 8/8] Update changelog --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 4f1b574e..40f29723 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changelog for babelizer 0.3.7 (unreleased) ------------------ -- Nothing changed yet. +- Use GitHub Actions for continuous integration (#39) 0.3.6 (2021-01-13)