Skip to content

Commit

Permalink
Merge branch 'main' into injections
Browse files Browse the repository at this point in the history
  • Loading branch information
cisaacstern authored Oct 3, 2023
2 parents 50618c5 + 7e34030 commit 07da347
Show file tree
Hide file tree
Showing 105 changed files with 2,055 additions and 16,478 deletions.
65 changes: 24 additions & 41 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,41 @@ on:
branches: [ "main" ]
paths-ignore:
- 'docs/**'
schedule:
- cron: '0 4 * * *' # run once a day at 4 AM

env:
PYTEST_ADDOPTS: "--color=yes"

# This our primary testing workflow.
#
# It also serves as an example for how to reference the separate prepare-env workflow.
# This workflow does not even attempt to build environments. It dispatches that resposibility
# to the prepare-env workflow and then loads the environments which that workflow has cached.
#
# Note that all of the steps listed under the comment ``# generic steps to load env from cache``
# are required to load the environment. They include:
# - Generating the cache key
# - Actually loading the environment using the key
# - Adding the path ``/usr/share/miniconda3/envs/pangeo-forge-recipes/bin`` to $PATH

jobs:
prepare-env:
uses: ./.github/workflows/prepare-env.yaml
run-tests:
needs: prepare-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
dependencies: ["releases-only", "upstream-dev"]
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2

# generic steps to load env from cache
- name: 🎯 Set cache number
id: cache-number
# cache will last 3 days by default
run: echo CACHE_NUMBER=`expr $(date +'%j') / 3` >> $GITHUB_ENV
- name: 🎯 Set environment file
id: env-file
run: echo "env_file=ci/py${{ matrix.python-version }}.yml" >> $GITHUB_ENV
- uses: actions/cache@v2
name: πŸ—ƒ Loaded Cached environment
- uses: actions/checkout@v4
- name: πŸ” Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
path: /usr/share/miniconda3/envs/pangeo-forge-recipes
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles( env.env_file ) }}-${{ matrix.dependencies }}-${{ env.CACHE_NUMBER }}
id: conda-cache
- name: 🀿 Bail out if no cache hit
if: steps.conda-cache.outputs.cache-hit != 'true'
run: false
- name: 🎯 Set path to include conda python
run: echo "/usr/share/miniconda3/envs/pangeo-forge-recipes/bin" >> $GITHUB_PATH

# custom testing steps unique to this workflow
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: 🎯 Check cache hit
run: echo '${{ steps.setup-python.outputs.cache-hit }}'
- name: 🌈 Install pangeo-forge-recipes package
shell: bash -l {0}
run: |
python -m pip install --no-deps -e .
python -m pip install -e ".[dev]"
- name: πŸ§‘β€πŸ’» On the nightly run, test upstream dev versions
if: |
github.event_name == 'schedule'
shell: bash -l {0}
run: |
python -m pip install -Ur ci/requirements-upstream-dev.txt
python -m pip install -U --pre apache-beam
- name: πŸ„β€β™‚οΈ Run Tests
shell: bash -l {0}
run: |
Expand All @@ -73,7 +53,10 @@ jobs:
--cov-report xml \
--durations=10 --durations-min=1.0
- name: 🚦 Run Codecov
uses: codecov/[email protected]
if: |
github.event_name == 'push' ||
github.event_name == 'pull_request'
uses: codecov/[email protected]
with:
file: ./coverage.xml
env_vars: OS,PYTHON
Expand Down
81 changes: 0 additions & 81 deletions .github/workflows/prepare-env.yaml

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools setuptools-scm wheel twine toml
python -m pip install --upgrade setuptools setuptools-scm build twine
- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
python setup.py --version
python -m build
twine check dist/*
twine upload dist/*
16 changes: 0 additions & 16 deletions .github/workflows/slash-command-dispatch.yaml

This file was deleted.

55 changes: 24 additions & 31 deletions .github/workflows/test-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
PYTEST_ADDOPTS: "--color=yes"

jobs:
prepare-env:
integration-tests:
# run on:
# - all pushes to specified branch(es)
# - a PR was just labeled 'test-integration'
Expand All @@ -20,44 +20,37 @@ jobs:
github.event_name == 'push' ||
github.event.label.name == 'test-integration' ||
contains( github.event.pull_request.labels.*.name, 'test-integration')
uses: ./.github/workflows/prepare-env.yaml
integration-tests:
needs: prepare-env
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
dependencies: ["releases-only", "upstream-dev"]
# the runner versions tested here are pinned to an older version of apache-beam which is not
# necessarily expected to work on python > 3.9. For one additional context point, see:
# https://github.com/pangeo-forge/pangeo-forge-recipes/issues/540#issuecomment-1685096271
# Once https://github.com/pangeo-forge/pangeo-forge-runner/pull/90 goes in, we can add back
# integration testing for 3.10 and 3.11 (for runner versions that follow that PR).
python-version: ["3.9"] # , "3.10", "3.11"]
runner-version: [
"pangeo-forge-runner==0.8.0",
"git+https://github.com/pangeo-forge/pangeo-forge-runner.git@injections#egg=pangeo_forge_runner",
]
steps:
- uses: actions/checkout@v2

# generic steps to load env from cache
- name: 🎯 Set cache number
id: cache-number
# cache will last 3 days by default
run: echo CACHE_NUMBER=`expr $(date +'%j') / 3` >> $GITHUB_ENV
- name: 🎯 Set environment file
id: env-file
run: echo "env_file=ci/py${{ matrix.python-version }}.yml" >> $GITHUB_ENV
- uses: actions/cache@v2
name: πŸ—ƒ Loaded Cached environment
- uses: actions/checkout@v4
- name: πŸ” Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
path: /usr/share/miniconda3/envs/pangeo-forge-recipes
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles( env.env_file ) }}-${{ matrix.dependencies }}-${{ env.CACHE_NUMBER }}
id: conda-cache
- name: 🀿 Bail out if no cache hit
if: steps.conda-cache.outputs.cache-hit != 'true'
run: false
- name: 🎯 Set path to include conda python
run: echo "/usr/share/miniconda3/envs/pangeo-forge-recipes/bin" >> $GITHUB_PATH

# custom testing steps unique to this workflow
- name: 🌈 Install pangeo-forge-recipes package
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: 🎯 Check cache hit
run: echo '${{ steps.setup-python.outputs.cache-hit }}'
- name: 🌈 Install pangeo-forge-recipes & pangeo-forge-runner
shell: bash -l {0}
run: |
python -m pip install --no-deps -e .
python -m pip install -e ".[dev]"
python -m pip install ${{ matrix.runner-version }}
- name: πŸ„β€β™‚οΈ Run Tests
shell: bash -l {0}
run: |
pytest --timeout=600 tests-integration/ -v
pytest --timeout=600 -vvxs tests/test_integration.py --run-integration
Loading

0 comments on commit 07da347

Please sign in to comment.