forked from ESMValGroup/ESMValTool
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (97 loc) · 3.04 KB
/
create-condalock-file.yml
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: Conda lock file creation
on:
# Trigger on push on main or other branch for testing
# NOTE that push: main will create the file very often
# and hence lots of automated PRs
# push:
# branches:
# - condalock-update
schedule:
- cron: '0 4 */10 * *'
jobs:
create-lock-file:
name: Create conda lock file for latest Python
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: esmvaltool-fromlock
python-version: "3.11"
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- name: Show conda config
shell: bash -l {0}
run: |
conda update -n base -c conda-forge conda
conda info
conda list
conda config --show-sources
conda config --show
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Install conda-lock
shell: bash -l {0}
run: mamba install -y conda-lock
- name: Check version of conda-lock
shell: bash -l {0}
run: conda-lock --version
- name: Create conda lock file for linux-64
shell: bash -l {0}
run: conda-lock lock --platform linux-64 -f environment.yml --mamba --kind explicit
- shell: bash -l {0}
run: conda --version
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: python -V
- shell: bash -l {0}
run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- shell: bash -l {0}
run: mamba install -y pip
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: pip --version
- shell: bash -l {0}
run: pip install -e .[develop]
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version
- shell: bash -l {0}
run: flake8
- shell: bash -l {0}
run: pytest -n 2 -m "not installation"
# Automated PR
# see https://github.com/marketplace/actions/create-pull-request
- name: Create Automated PR if conda lock file has changed
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Updating Linux condalock file
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: condalock-update
delete-branch: true
title: '[Condalock] Update Linux condalock file'
body: |
Update condalock file
Automatic Pull Request.
labels: |
testing
condalock
automatedPR
assignees: valeriupredoi
reviewers: valeriupredoi
team-reviewers: |
owners
maintainers
draft: false