Skip to content

docs: Update examples to use AlmaLinux 9 (#54) #127

docs: Update examples to use AlmaLinux 9 (#54)

docs: Update examples to use AlmaLinux 9 (#54) #127

Workflow file for this run

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