-
Notifications
You must be signed in to change notification settings - Fork 2
162 lines (144 loc) · 4.96 KB
/
ci.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
venv-name: ["example", "name-with-hyphens"]
setup-command: [". /release_setup.sh", "lsetup 'views LCG_105 x86_64-el9-gcc12-opt'"]
container:
image: gitlab-registry.cern.ch/atlas/athena/analysisbase:25.2.9
options: --user root
env:
HOME: /home/atlas
defaults:
run:
shell: bash
# container options: --workdir not supported https://github.com/actions/runner/issues/878
# so set working-directory instead
working-directory: /workdir
steps:
- uses: actions/checkout@v4
- name: Setup directories
run: |
# c.f. https://github.com/actions/runner/issues/2058 for why not using container volumes
# Copy files from the GITHUB_WORKSPACE to the selected working directory
cp -r "${GITHUB_WORKSPACE}"/cvmfs-venv.sh .
# Avoid warnings about cache ownership
chown --recursive "$(id -u)" ~/
- name: Check runtime information
run: |
echo "USER=${USER}"
echo "CWD=$(pwd)"
echo "env:"
env
echo "id:"
id
- name: Place ~/.local/bin on PATH
run: |
mkdir -p ~/.local/bin
# Need root permissions to set GITHUB_ENV
echo "PATH=$(readlink -f ~)/.local/bin:${PATH}" >> $GITHUB_ENV
- name: Install cvmfs-venv locally
run: |
echo "PATH=${PATH}"
mv cvmfs-venv.sh ~/.local/bin/cvmfs-venv
echo "cvmfs-venv is: $(command -v cvmfs-venv)"
. cvmfs-venv --help
- name: Setup default venv using /release_setup.sh
run: |
. cvmfs-venv
echo "# cat $(find . -type f -iname pyvenv.cfg)"
cat $(find . -type f -iname pyvenv.cfg)
echo "# Python runtime: $(command -v python)"
python --version --version
echo "PATH=${PATH}"
echo "PYTHONPATH=${PYTHONPATH}"
echo "# cat $(find . -type f -iname pyvenv.cfg)"
cat $(find . -type f -iname pyvenv.cfg)
- name: Remove default venv
run: |
rm -rf venv
- name: Setup venv "${{ matrix.venv-name }}" using /release_setup.sh
run: |
. cvmfs-venv --setup "${{ matrix.setup-command }}" ${{ matrix.venv-name }}
echo "# cat $(find . -type f -iname pyvenv.cfg)"
cat $(find . -type f -iname pyvenv.cfg)
echo "# Python runtime: $(command -v python)"
python --version --version
echo "PATH=${PATH}"
echo "PYTHONPATH=${PYTHONPATH}"
- name: List installed Python packages
run: |
. /release_setup.sh
. ${{ matrix.venv-name }}/bin/activate
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
- name: Update NumPy and install Uproot
run: |
. /release_setup.sh
. ${{ matrix.venv-name }}/bin/activate
echo "# uv pip install --upgrade numpy uproot"
uv pip install --upgrade numpy uproot
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
echo "# uv pip list"
uv pip list
- name: Deactivate environment
run: |
. /release_setup.sh
. ${{ matrix.venv-name }}/bin/activate
echo "# deactivate"
deactivate
echo "# Python runtime: $(command -v python)"
echo "PATH=${PATH}"
echo "PYTHONPATH=${PYTHONPATH}"
echo "# python -m pip list"
python -m pip list
- name: Uninstall NumPy to demonstrate can
run: |
. /release_setup.sh
. ${{ matrix.venv-name }}/bin/activate
echo "# python -m pip uninstall -y numpy"
python -m pip uninstall -y numpy
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
- name: Remove venv "${{ matrix.venv-name }}"
run: |
rm -rf ${{ matrix.venv-name }}
- name: Setup default venv with --no-system-site-packages option
run: |
. cvmfs-venv --no-system-site-packages
echo "# cat $(find . -type f -iname pyvenv.cfg)"
cat $(find . -type f -iname pyvenv.cfg)
echo "# Python runtime: $(command -v python)"
python --version --version
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
rm -rf venv
- name: Setup default venv with --no-update option
run: |
. cvmfs-venv --no-update
echo "# cat $(find . -type f -iname pyvenv.cfg)"
cat $(find . -type f -iname pyvenv.cfg)
echo "# Python runtime: $(command -v python)"
python --version --version
echo "# python -m pip list"
python -m pip list
echo "# python -m pip list --local"
python -m pip list --local
rm -rf venv