diff --git a/.github/workflows/_test.yaml b/.github/workflows/_test.yaml deleted file mode 100644 index 8aad0739..00000000 --- a/.github/workflows/_test.yaml +++ /dev/null @@ -1,82 +0,0 @@ -name: test - -on: - workflow_call: - inputs: - os: - required: true - type: string - python-version: - required: true - type: string - -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: 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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 67030d7b..9429d9c6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -7,15 +7,92 @@ on: branches: - '*' workflow_dispatch: + 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: ['3.7', '3.9', '3.11'] - uses: ./.github/workflows/_test.yaml - with: - os: "${{ matrix.os }}" - python-version: "${{ matrix.python-version }}" + # Run on the full set on schedule, workflow_dispatch and push&tags events, otherwise on a subset. + python-version: ${{ ( github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'push' && github.ref_type == 'tag' ) ) && fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11"]') || fromJSON('["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 + - name: doit develop_install + if: matrix.os != 'macos-latest' + run: | + conda activate test-environment + doit develop_install -o tests -o examples -o recommended --conda-mode=mamba + # Temporary hacked step as on MacOS doit develop_install updated CPython leading to a pyctdev failure + - name: doit develop_install + if: matrix.os == 'macos-latest' + run: | + conda activate test-environment + doit develop_install -o tests -o examples -o recommended --conda-mode=mamba || echo "Keep going" + pip install --no-deps --no-build-isolation -e . + - 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 diff --git a/.github/workflows/weekly_test.yaml b/.github/workflows/weekly_test.yaml deleted file mode 100644 index c527ac31..00000000 --- a/.github/workflows/weekly_test.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: weekly_tests -on: - schedule: - - cron: '0 18 * * SUN' - -jobs: - test_suite: - strategy: - fail-fast: false - matrix: - os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - uses: ./.github/workflows/_test.yaml - with: - os: "${{ matrix.os }}" - python-version: "${{ matrix.python-version }}"