|
| 1 | +name: CI Upstream |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + pull_request: |
| 7 | + types: [opened, reopened, synchronize, labeled] |
| 8 | + branches: |
| 9 | + - main |
| 10 | + schedule: |
| 11 | + - cron: "0 0 * * *" # Daily “At 00:00” UTC |
| 12 | + workflow_dispatch: # allows you to trigger the workflow run manually |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + upstream-dev: |
| 20 | + name: upstream-dev |
| 21 | + runs-on: ubuntu-latest |
| 22 | + if: ${{ contains( github.event.pull_request.labels.*.name, 'test-upstream') && github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} |
| 23 | + defaults: |
| 24 | + run: |
| 25 | + shell: bash -l {0} |
| 26 | + strategy: |
| 27 | + fail-fast: false |
| 28 | + matrix: |
| 29 | + python-version: ["3.10"] |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v3 |
| 32 | + with: |
| 33 | + fetch-depth: 0 # Fetch all history for all branches and tags. |
| 34 | + - name: Set environment variables |
| 35 | + run: | |
| 36 | + echo "PYTHON_VERSION=${{ matrix.python-version }}" >> $GITHUB_ENV |
| 37 | + - name: Set up conda environment |
| 38 | + uses: mamba-org/provision-with-micromamba@v14 |
| 39 | + with: |
| 40 | + environment-file: ci/upstream-dev-env.yml |
| 41 | + environment-name: flox-tests |
| 42 | + extra-specs: | |
| 43 | + python="${{ matrix.python-version }}" |
| 44 | + pytest-reportlog |
| 45 | + - name: Install flox |
| 46 | + run: | |
| 47 | + python -m pip install --no-deps -e . |
| 48 | + - name: Run Tests |
| 49 | + if: success() |
| 50 | + id: status |
| 51 | + run: | |
| 52 | + pytest -rf -n auto --cov=./ --cov-report=xml \ |
| 53 | + --report-log output-${{ matrix.python-version }}-log.jsonl |
| 54 | + - name: Generate and publish the report |
| 55 | + if: | |
| 56 | + failure() |
| 57 | + && steps.status.outcome == 'failure' |
| 58 | + && github.event_name == 'schedule' |
| 59 | + && github.repository_owner == 'xarray-contrib' |
| 60 | + uses: xarray-contrib/issue-from-pytest-log@v1 |
| 61 | + with: |
| 62 | + log-path: output-${{ matrix.python-version }}-log.jsonl |
0 commit comments