Skip to content

Commit

Permalink
Update CI file.
Browse files Browse the repository at this point in the history
  • Loading branch information
aleberti committed Aug 23, 2023
1 parent 3da6d78 commit a9f5967
Showing 1 changed file with 21 additions and 32 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,52 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.8"]
ctapipe-version: [v0.12.0]
extra-args: ['codecov']

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

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set python version ${{ matrix.python-version }}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
sed -i -e "s/- python.*/- python=$PYTHON_VERSION/g" environment.yml
echo "Resulting environment file:"
cat environment.yml
- name: Create and activate env
uses: mamba-org/provision-with-micromamba@v14
with:
python-version: ${{ matrix.python-version }}
environment-name: magicio
environment-file: environment.yml
cache-downloads: true

- name: Install dependencies
env:
PYTHON_VERSION: ${{ matrix.python-version }}
CTAPIPE_VERSION: ${{ matrix.ctapipe-version }}

run: |
. $CONDA/etc/profile.d/conda.sh
conda config --set always_yes yes --set changeps1 no
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
conda install mamba -n base -c conda-forge
mamba env create -n ci -f environment.yml
conda activate ci
# we install ctapipe using pip to be able to select any commit, e.g. the current master
pip install pytest-cov "git+https://github.com/cta-observatory/ctapipe@$CTAPIPE_VERSION"
pip install pyflakes
python --version
pip install -e .
pip install pytest-cov "ctapipe==$CTAPIPE_VERSION"
pip install pyflakes
ctapipe-info --version | grep "$CTAPIPE_VERSION"
git describe --tags
- name: Static codechecks
# need to use a login shell for the conda setup to work
shell: bash -leo pipefail {0}
run: |
source $CONDA/etc/profile.d/conda.sh
conda activate ci
pyflakes magicctapipe
#- name: Download test data
# env:
# TEST_DATA_USER: ${{ secrets.test_data_user }}
# TEST_DATA_PASSWORD: ${{ secrets.test_data_password }}
# run: |
# chmod +x ./download_test_data.sh
# ./download_test_data.sh

- name: Tests
env:
MAGIC_CTA_DATA_USER: ${{ secrets.magic_cta_data_user }}
MAGIC_CTA_DATA_PASSWORD: ${{ secrets.magic_cta_data_password }}
run: |
# github actions starts a new shell for each "step", so we need to
# activate our env again
source $CONDA/etc/profile.d/conda.sh
conda activate ci
coverage run -m pytest -v
coverage xml
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3

0 comments on commit a9f5967

Please sign in to comment.