File: upstream-dev.yaml

package info (click to toggle)
xarray-safe-rcm 2026.01.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 216 kB
  • sloc: python: 1,083; sh: 23; makefile: 4
file content (99 lines) | stat: -rw-r--r-- 2,587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: upstream-dev CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: "0 18 * * 0" # Weekly "On Sundays at 18:00" UTC
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  detect-test-upstream-trigger:
    name: "Detect CI Trigger: [test-upstream]"
    if: 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@v6
        with:
          fetch-depth: 2
      - uses: xarray-contrib/ci-trigger@v1.2
        id: detect-trigger
        with:
          keyword: "[test-upstream]"

  upstream-dev:
    name: upstream-dev
    runs-on: ubuntu-latest
    needs: detect-test-upstream-trigger

    if: |
      always()
      && github.repository == 'umr-lops/xarray-safe-rcm'
      && (
        github.event_name == 'schedule'
        || github.event_name == 'workflow_dispatch'
        || needs.detect-test-upstream-trigger.outputs.triggered == 'true'
        || contains(github.event.pull_request.labels.*.name, 'run-upstream')
      )

    defaults:
      run:
        shell: bash -l {0}

    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.12"]

    steps:
      - name: checkout the repository
        uses: actions/checkout@v6
        with:
          # need to fetch all tags to get a correct version
          fetch-depth: 0 # fetch all branches and tags

      - name: set up conda environment
        uses: mamba-org/setup-micromamba@v2
        with:
          environment-file: ci/requirements/environment.yaml
          environment-name: tests
          create-args: >-
            python=${{ matrix.python-version }}
            pytest-reportlog
            conda

      - name: install upstream-dev dependencies
        run: bash ci/install-upstream-dev.sh

      - name: install the package
        run: python -m pip install --no-deps -e .

      - name: show versions
        run: python -m pip list

      - name: import
        run: |
          python -c 'import safe_rcm'

      - name: run tests
        if: success()
        id: status
        run: |
          python -m pytest -rf --report-log=pytest-log.jsonl

      - name: report failures
        if: |
          failure()
          && steps.tests.outcome == 'failure'
          && github.event_name == 'schedule'
        uses: xarray-contrib/issue-from-pytest-log@v1
        with:
          log-path: pytest-log.jsonl