python version maintenance #407
Workflow file for this run
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| detect-skip-ci-trigger: | |
| name: "Detect CI Trigger: [skip-ci]" | |
| if: | | |
| github.repository == 'umr-lops/xarray-ceos-alos2' | |
| && github.event_name == 'push' | |
| || github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 2 | |
| persist-credentials: false | |
| - uses: xarray-contrib/ci-trigger@10cd2bfec3484946a4058a421ddf9cfad101e715 # v1.2.1 | |
| id: detect-trigger | |
| with: | |
| keyword: "[skip-ci]" | |
| ci: | |
| name: ${{ matrix.os }} ${{ matrix.env }} | |
| runs-on: ${{ matrix.os }} | |
| needs: detect-skip-ci-trigger | |
| if: needs.detect-skip-ci-trigger.outputs.triggered == 'false' | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: ["test-py311", "test-py314"] | |
| os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
| env: | |
| PIXI_ENV: ${{ matrix.env }} | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| # need to fetch all tags to get a correct version | |
| fetch-depth: 0 # fetch all branches and tags | |
| persist-credentials: false | |
| - name: Setup environment variables | |
| run: | | |
| echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0 | |
| with: | |
| cache: true | |
| environments: ${{ matrix.env }} | |
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| - name: Import xarray-ceos-alos2 | |
| run: | | |
| pixi run -e "$PIXI_ENV" --frozen python -c "import ceos_alos2" | |
| - name: Run tests | |
| run: | | |
| pixi run -e "$PIXI_ENV" --frozen python -m pytest --cov=ceos_alos2 |