-
Notifications
You must be signed in to change notification settings - Fork 20
84 lines (74 loc) · 2.62 KB
/
python-package-conda.yml
File metadata and controls
84 lines (74 loc) · 2.62 KB
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
name: CI
on:
push:
branches:
- "**"
tags:
- "**"
pull_request:
workflow_dispatch:
schedule:
- cron: "0 2 * * *" # Daily at 02:00 UTC
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04]
python-version: ['3.12', '3.13', '3.14']
ctapipe-version: ['0.25.0', 'latest', 'nightly']
max-parallel: 6
runs-on: ${{ matrix.os }}
# Allow failures for nightly ctapipe builds
continue-on-error: ${{ matrix.ctapipe-version == 'nightly'}}
steps:
- uses: actions/checkout@v4
- name: Set up Miniconda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
echo "$HOME/miniconda/bin" >> $GITHUB_PATH
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate base
conda config --add channels conda-forge
conda install -y mamba
- name: Create environment for Python ${{ matrix.python-version }}
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate base
mamba create -y -n dl1dh -c conda-forge python==${{ matrix.python-version }}
conda activate dl1dh
- name: Pre-script setup
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate dl1dh
sudo apt-get update
sudo apt-get install -y git
pip install --upgrade pip
pip install pylint pylint-exit anybadge
pip install eventio
if [ "${{ matrix.ctapipe-version }}" = "nightly" ]; then
pip install git+https://github.com/cta-observatory/ctapipe.git
elif [ "${{ matrix.ctapipe-version }}" = "latest" ]; then
pip install ctapipe
else
pip install ctapipe==${{ matrix.ctapipe-version }}
fi
pip install pytest flake8
- name: Add MKL_THREADING_LAYER variable
run: echo "MKL_THREADING_LAYER=GNU" >> $GITHUB_ENV
- name: Lint with flake8
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate dl1dh
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package with pip
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate dl1dh
pip install -e .
- name: Run pytest
run: |
source $HOME/miniconda/etc/profile.d/conda.sh
conda activate dl1dh
pytest