Skip to content

Commit

Permalink
attempt to use tox with install-esmf-action
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Oct 17, 2023
1 parent 377f7a8 commit ee9b949
Showing 1 changed file with 66 additions and 19 deletions.
85 changes: 66 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
Expand All @@ -34,25 +34,81 @@ jobs:
run: |
tox -e black
testing:
name: Test with Python${{ matrix.python-version }}
testing-pypi:
name: Test with Python${{ matrix.python-version }} (tox)
needs: black
runs-on: ubuntu-latest
env:
ESMF_VERSION: "v8.5.0"
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
# tox-build: "py39"
tox-build: "py39"
- python-version: "3.10"
# tox-build: "py310"
tox-build: "py310"
- python-version: "3.11"
# tox-build: "py311"
tox-build: "py311"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install NetCDF
run: |
sudo apt-get -y update
sudo apt install libnetcdf-dev libnetcdff-dev
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_NETCDF: nc-config
with:
cache: true
version: ${{ env.ESMF_VERSION }}
- name: Set up Python${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
pip install tox
- name: Test with tox
run: |
tox -e ${{ matrix.tox-env }}
env:
ESMF_VERSION: ${{ env.ESMF_VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-Python${{ matrix.python-version }}
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github

# - name: Install tox-current-env
# run: |
# pip install tox tox-conda tox-current-env
# - name: Test with tox
# run: |
# tox -vv -e ${{ matrix.tox-build }} --current-env
# env:
# CONDA_EXE: mamba
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

testing-conda:
name: Test with Python${{ matrix.python-version }}m (conda)
needs: black
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Conda (Micromamba) with Python ${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1
with:
Expand Down Expand Up @@ -85,23 +141,14 @@ jobs:
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: run-Python${{ matrix.python-version }}
COVERALLS_FLAG_NAME: run-Python${{ matrix.python-version }}-conda
COVERALLS_PARALLEL: true
COVERALLS_SERVICE_NAME: github

# - name: Install tox-current-env
# run: |
# pip install tox tox-conda tox-current-env
# - name: Test with tox
# run: |
# tox -vv -e ${{ matrix.tox-build }} --current-env
# env:
# CONDA_EXE: mamba
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

finish:
needs:
- testing
- testing-pypi
- testing-conda
runs-on: ubuntu-latest
container: python:3-slim
steps:
Expand Down

0 comments on commit ee9b949

Please sign in to comment.