Skip to content

Commit

Permalink
Try to split up the the test file
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Dec 5, 2022
1 parent 1b9d0af commit 9349106
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 78 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: test

on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
# secrets: inherit

jobs:
test:
name: Pytest on ${{ inputs.os }} with Python ${{ inputs.python-version }}
runs-on: ${{ inputs.os }}
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
env:
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAMBA_NO_BANNER: 1
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow
- name: conda setup
run: |
conda install -n base -c conda-forge mamba --no-update-deps
conda install -c conda-forge "nodejs=15.3.0" --no-update-deps
conda create -n test-environment
conda activate test-environment
conda config --env --append channels pyviz/label/dev --append channels conda-forge
conda config --env --remove channels defaults
conda install python=${{ inputs.python-version }} pyctdev
echo $(python --version | tr ' [:upper:]' '=[:lower:]') > $CONDA_PREFIX/conda-meta/pinned
- name: doit develop_install
run: |
conda activate test-environment
doit develop_install -o tests -o examples -o recommended --conda-mode=mamba
- name: patch fiona/geostack on Python 3.7 / Macos
if: contains(inputs.os, 'macos') && inputs.python-version == '3.7'
run: |
conda activate test-environment
mamba install "fiona=1.8" "gdal=3.3"
- name: doit env_capture
run: |
conda activate test-environment
doit env_capture
- name: download test data
run: |
conda activate test-environment
bokeh sampledata
geoviews fetch-data --path=examples
- name: git describe
run: |
git describe
- name: doit test_flakes
run: |
conda activate test-environment
doit test_flakes
- name: doit test_unit
run: |
conda activate test-environment
doit test_unit
- name: test examples
run: |
conda activate test-environment
doit test_examples
- name: codecov
if: github.event_name == 'push'
run: |
conda activate test-environment
codecov
86 changes: 8 additions & 78 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,88 +7,18 @@ on:
branches:
- '*'
workflow_dispatch:
schedule:
- cron: '0 18 * * SUN'
# schedule:
# - cron: '0 18 * * SUN'

jobs:
test_suite:
name: Pytest on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version:
- if: github.event.schedule == '0 18 * * SUN'
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
- if: github.event.schedule != '0 18 * * SUN'
python-version: ['3.7', '3.9', '3.11']
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
env:
DISPLAY: ":99.0"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAMBA_NO_BANNER: 1
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "100"
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow
- name: conda setup
run: |
conda install -n base -c conda-forge mamba --no-update-deps
conda install -c conda-forge "nodejs=15.3.0" --no-update-deps
conda create -n test-environment
conda activate test-environment
conda config --env --append channels pyviz/label/dev --append channels conda-forge
conda config --env --remove channels defaults
conda install python=${{ matrix.python-version }} pyctdev
echo $(python --version | tr ' [:upper:]' '=[:lower:]') > $CONDA_PREFIX/conda-meta/pinned
- name: doit develop_install
run: |
conda activate test-environment
doit develop_install -o tests -o examples -o recommended --conda-mode=mamba
- name: patch fiona/geostack on Python 3.7 / Macos
if: contains(matrix.os, 'macos') && matrix.python-version == '3.7'
run: |
conda activate test-environment
mamba install "fiona=1.8" "gdal=3.3"
- name: doit env_capture
run: |
conda activate test-environment
doit env_capture
- name: download test data
run: |
conda activate test-environment
bokeh sampledata
geoviews fetch-data --path=examples
- name: git describe
run: |
git describe
- name: doit test_flakes
run: |
conda activate test-environment
doit test_flakes
- name: doit test_unit
run: |
conda activate test-environment
doit test_unit
- name: test examples
run: |
conda activate test-environment
doit test_examples
- name: codecov
if: github.event_name == 'push'
run: |
conda activate test-environment
codecov
# python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.7', '3.9', '3.11']
uses: ./.github/workflows/_test.yaml
with:
os: "${{ matrix.os }}"
python-version: "${{ matrix.python-version }}"

0 comments on commit 9349106

Please sign in to comment.