2020 should_skip : ${{ steps.skip_check.outputs.should_skip }}
2121 steps :
2222 - id : skip_check
23- uses : fkirc/skip-duplicate-actions@master
23+ uses : fkirc/skip-duplicate-actions@v5
2424 with :
2525 cancel_others : true
2626 paths_ignore : ' ["**/README.md", "**/docs/**", "**/ISSUE_TEMPLATE/**", "**/pull_request_template.md", "**/.vscode/**"]'
@@ -32,66 +32,61 @@ jobs:
3232 timeout-minutes : 10
3333 steps :
3434 - name : Checkout Code Repository
35- uses : actions/checkout@v3
36-
35+ uses : actions/checkout@v4
36+
3737 - name : Set up Python
38- uses : actions/setup-python@v4
38+ uses : actions/setup-python@v5
3939 with :
40- python-version : ' 3.10 '
40+ python-version : ' 3.13 '
4141
4242 - name : Install and Run Pre-commit
43- uses :
pre-commit/[email protected] .0 43+ uses :
pre-commit/[email protected] .1 4444
4545 build :
4646 needs : check-jobs-to-skip
4747 if : ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true' }} || ${{ github.event_name == 'push' }}
4848 runs-on : ubuntu-latest
49+ strategy :
50+ fail-fast : false
51+ matrix :
52+ python-version : ["3.10", "3.11", "3.12", "3.13"]
4953 defaults :
5054 run :
5155 shell : bash -l {0}
5256 timeout-minutes : 15
5357 steps :
54- - uses : actions/checkout@v3
55-
58+ - uses : actions/checkout@v4
59+ - name : Get Date
60+ id : get-date
61+ run : echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
5662 - name : Set up Conda Environment
5763 uses : conda-incubator/setup-miniconda@v3
5864 with :
5965 miniforge-variant : Miniforge3
6066 miniforge-version : latest
61- activate-environment : " pcmdi_metrics_ci"
67+ activate-environment : pcmdi_metrics_ci
6268 environment-file : conda-env/ci.yml
6369 channel-priority : flexible
6470 auto-update-conda : true
6571 python-version : ${{ matrix.python-version }}
6672 use-mamba : false
6773 conda-solver : classic
6874
75+ - name : Cache Conda Packages
76+ uses : actions/cache@v4
77+ with :
78+ path : ~/conda_pkgs_dir
79+ key : conda-${{ runner.os }}--${{ runner.arch }}--py${{ matrix.python-version }}--${{ steps.get-date.outputs.today }}--${{ hashFiles('conda-env/ci.yml') }}--${{ env.CACHE_NUMBER }}
80+ env :
81+ CACHE_NUMBER : 0
82+
6983 - name : Verify Conda Environment
7084 run : |
7185 conda info
7286 conda list
7387 conda config --show-sources
7488 conda config --show
7589
76- # Used for refreshing the cache every 24 hours to avoid inconsistencies of package
77- # versions between the CI pipeline and local installations.
78- - name : Get Date
79- id : get-date
80- run : echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
81- shell : bash
82-
83- - name : Cache Conda
84- uses : actions/cache@v3
85- with :
86- path : ${{ env.CONDA }}/envs
87- key :
88- conda-${{ runner.os }}--${{ runner.arch }}--${{
89- steps.get-date.outputs.today }}-${{
90- hashFiles('conda-env/ci.yml') }}-${{ env.CACHE_NUMBER}}
91- env :
92- # Increase this value to reset cache if conda/dev.yml has not changed in the workflow
93- CACHE_NUMBER : 0
94-
9590 - name : Install pcmdi_metrics
9691 # Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
9792 run : |
@@ -111,48 +106,53 @@ jobs:
111106 defaults :
112107 run :
113108 shell : bash -l {0}
114- timeout-minutes : 5
115109 steps :
116- - uses : actions/checkout@v3
110+ - uses : actions/checkout@v4
117111 with :
118112 persist-credentials : false
119113 fetch-depth : 0
120114
121115 - name : Cache Conda
122- uses : actions/cache@v3
116+ uses : actions/cache@v4
123117 env :
124- # Increase this value to reset cache if conda-env/ci.yml has not changed in the workflow
125118 CACHE_NUMBER : 0
126119 with :
127120 path : ~/conda_pkgs_dir
128- key : ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
129- hashFiles('conda-env/dev.yml') }}
121+ key : ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda-env/dev.yml') }}
130122
131123 - name : Set up Conda Environment
132124 uses : conda-incubator/setup-miniconda@v3
133125 with :
134- activate-environment : " pcmdi_metrics_dev"
126+ activate-environment : pcmdi_metrics_dev
127+ environment-file : conda-env/dev.yml
135128 miniforge-variant : Miniforge3
136129 miniforge-version : latest
137- environment-file : conda-env/dev.yml
138130 channel-priority : strict
139131 auto-update-conda : true
140- use-mamba : false # Disable libmamba solver
132+ use-mamba : false
133+ conda-solver : classic
134+ python-version : ' 3.13'
135+
136+ - name : Verify Conda Environment
137+ run : |
138+ conda info
139+ conda list
140+ conda config --show-sources
141+ conda config --show
141142
142143 - name : Install pcmdi_metrics
143- # Source: https://github.com/conda/conda-build/issues/4251#issuecomment-1053460542
144144 run : |
145- python -m pip install --no-build-isolation --no-deps -e .
145+ python -m pip install --no-build-isolation --no-deps -e .
146146
147147 - name : Sphinx build
148148 run : |
149149 sphinx-build docs _build
150-
150+
151151 - name : Deploy
152- uses : peaceiris/actions-gh-pages@v3
152+ uses : peaceiris/actions-gh-pages@v4
153153 if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
154154 with :
155- publish_branch : gh-pages
155+ publish_branch : gh-pages
156156 github_token : ${{ secrets.GITHUB_TOKEN }}
157157 publish_dir : _build/
158158 force_orphan : true
0 commit comments