Skip to content

Commit

Permalink
Merge pull request #1858 from cta-observatory/reduce_builds
Browse files Browse the repository at this point in the history
Do not run "push" build for Pull Requests, fix mamba build in CI
  • Loading branch information
maxnoe authored Mar 29, 2022
2 parents 70f29b1 + e8f5654 commit 0c7771f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 44 deletions.
28 changes: 0 additions & 28 deletions .github/install.sh

This file was deleted.

47 changes: 36 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- master
tags:
- '**'
pull_request:

env:
NUMBA_NUM_THREADS: 1
Expand All @@ -20,28 +26,47 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: cache test data
uses: actions/cache@v2
with:
path: |
~/.cache/ctapipe
path: ~/.cache/ctapipe
key: ctapipe-test-data

- uses: conda-incubator/setup-miniconda@v2
- name: Prepare conda installation
if: matrix.install-method == 'conda'
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
# fix mamba error that the directory does not exist
mkdir -p ~/conda_pkgs_dir/cache
# setup correct python version
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
- name: Conda setup
if: matrix.install-method == 'conda'
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
mamba-version: "*"
auto-update-conda: true
activate-environment: "cta-dev"
environment-file: environment.yml

- name: Python setup
if: matrix.install-method == 'pip'
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}

- name: Update pip
if: matrix.install-method == 'pip'
run: pip install -U pip

- name: Install dependencies
env:
INSTALL_METHOD: ${{ matrix.install-method }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
source .github/install.sh
python --version
pip install codecov pytest-cov pyflakes pytest-xdist 'coverage!=6.3.0'
pip install .[all]
Expand Down
11 changes: 6 additions & 5 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# A conda environment with all useful package for ctapipe developers
name: cta-dev
channels:
- conda-forge
- default
- cta-observatory
dependencies:
- python=3.7
- python=3.8
- pip
- astropy
- black
- bokeh=1
- conda-forge::nbsphinx
- nbsphinx
- cython
- graphviz
- h5py
Expand Down Expand Up @@ -43,5 +43,6 @@ dependencies:
- xz
- zlib
- zstandard
- conda-forge::eventio>=1.5.0
- conda-forge::corsikaio
- eventio>=1.5.0
# for bokeh=1, remove when updating bokeh
- jinja2=3.0
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"requests",
"setuptools_scm>=3.4",
"importlib_resources;python_version<'3.9'",
"jinja2~=3.0.2", # for bokeh=1, remove when updaiting bokeh
],
# here are optional dependencies (as "tag" : "dependency spec")
extras_require={
Expand Down

0 comments on commit 0c7771f

Please sign in to comment.