New --tidy option in geovista download CLI (#2079)
#5244
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Reference: | |
| # - https://github.com/actions/checkout | |
| # - https://github.com/actions/download-artifact | |
| # - https://github.com/actions/setup-python | |
| # - https://github.com/actions/upload-artifact | |
| # - https://github.com/codecov/codecov-action | |
| # - https://github.com/prefix-dev/setup-pixi | |
| # - https://github.com/pyvista/setup-headless-display-action | |
| name: ci-tests | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "main" | |
| - "v*x" | |
| - "!pixi-auto-update" | |
| - "!pre-commit-ci-update-config" | |
| - "!dependabot/*" | |
| tags: | |
| - "v*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| permissions: {} | |
| jobs: | |
| tests: | |
| name: "${{ matrix.session }} ${{ matrix.marker }} (${{ matrix.version }})" | |
| runs-on: "${{ matrix.os }}" | |
| env: | |
| ALLOW_PLOTTING: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-22.04"] | |
| version: ["py312", "py313"] | |
| session: ["tests"] | |
| marker: ["image", "not image"] | |
| include: | |
| - version: "py313" | |
| coverage: "--cov-report= --cov=geovista" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: "environment configure" | |
| env: | |
| # Maximum cache period (in weeks) before forcing a cache refresh. | |
| CACHE_WEEKS: 2 | |
| run: | | |
| echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV} | |
| - uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 | |
| - name: "setup pixi" | |
| uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e | |
| with: | |
| environments: "test-${{ matrix.version }}" | |
| frozen: true | |
| activate-environment: true | |
| - name: "cartopy cache" | |
| uses: ./.github/workflows/composite/cartopy-cache | |
| with: | |
| cache_period: ${{ env.CACHE_PERIOD }} | |
| - name: "geovista cache" | |
| uses: ./.github/workflows/composite/geovista-cache | |
| with: | |
| cache_period: ${{ env.CACHE_PERIOD }} | |
| - name: "${{ matrix.session }} ${{ matrix.marker }} (${{ matrix.version }})" | |
| env: | |
| PY_COLORS: "1" | |
| run: | | |
| geovista --report | |
| xvfb-run -a pixi run --frozen pytest -m "${{ matrix.marker }}" --failed_image_dir test_images_failed ${{ matrix.coverage }} | |
| - name: "upload failed images" | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| with: | |
| name: ci-tests-failed-images-${{ github.job }}-${{ strategy.job-index }} | |
| path: ${{ github.workspace }}/test_images_failed | |
| - name: "prepare coverage" | |
| if: ${{ matrix.coverage }} | |
| env: | |
| COVERAGE_FILE: ci-test-coverage${{ strategy.job-index }} | |
| run: | | |
| mv .coverage ${COVERAGE_FILE} | |
| - if: ${{ matrix.coverage }} | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f | |
| with: | |
| name: coverage-artifacts-${{ github.job }}-${{ strategy.job-index }} | |
| path: ${{ github.workspace }}/ci-test-coverage* | |
| coverage: | |
| needs: [tests] | |
| name: "upload coverage" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 | |
| with: | |
| python-version: "3.x" | |
| - run: | | |
| python -m pip install --upgrade pip | |
| pip install coverage | |
| - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 | |
| with: | |
| pattern: coverage-artifacts-* | |
| merge-multiple: true | |
| - name: "create coverage report" | |
| run: | | |
| coverage combine ci-test-coverage* | |
| coverage xml --omit=*/_version.py | |
| - name: "upload coverage report" | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |