Skip to content

Commit

Permalink
Actions updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
ndilalla committed Sep 10, 2024
1 parent 5b4a568 commit 138a525
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 56 deletions.
34 changes: 6 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,12 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python-version }}
# - name: Cache conda
# uses: actions/cache@v4
# env:
# # Increase this value to reset cache if etc/example-environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
- name: Add conda ${{ matrix.python-version }} to system path
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "test_env"
auto-activate-base: false
#architecture: "x64"
miniforge-variant: Mambaforge
#miniforge-version: latest
python-version: ${{ matrix.python-version }}
auto-update-conda: true
environment-file: ${{ matrix.environment }}
Expand Down Expand Up @@ -158,13 +144,13 @@ jobs:
#conda install --use-local astromodels
conda install -c ${CONDA}/envs/test_env/conda-bld/ astromodels
- name: Test conda build
- name: Test import xspec
if: matrix.os != 'macos-latest'
shell: bash -l {0}
run: |
cd astromodels/tests
echo "======> importing XSPEC..."
python -c "import astromodels.xspec"
python -m pytest -vv --cov=astromodels --cov-report=xml
run: python -c "import astromodels.xspec"
- name: Test astromodels
shell: bash -l {0}
run: python -m pytest -vv --cov=astromodels --cov-report=xml
env:
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 1
Expand All @@ -188,14 +174,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
#- name: Cache conda
# uses: actions/cache@v4
# env:
# # Increase this value to reset cache if etc/example-environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
- name: Add conda ${{ matrix.python-version }} to system path
uses: conda-incubator/setup-miniconda@v3
with:
Expand Down
33 changes: 5 additions & 28 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Cache conda
# uses: actions/cache@v4
# env:
# # Increase this value to reset cache if etc/example-environment.yml has not changed
# CACHE_NUMBER: 0
# with:
# path: ~/conda_pkgs_dir
# key: conda-${{ matrix.os }}-python-${{ matrix.python-version }}-${{ hashFiles('ci/environment.yml') }}
- name: Add conda ${{ matrix.python-version }} to system path
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "test_env"
auto-activate-base: false
#architecture: "x64"
#mamba-version: "*"
miniforge-version: latest
python-version: ${{ matrix.python-version }}
auto-update-conda: true
environment-file: ${{ matrix.environment }}
use-only-tar-bz2: true
channel-priority: strict
channels: conda-forge, xspecmodels


- name: Init Env
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -170,24 +158,13 @@ jobs:
# stop the build if there are Python syntax errors or undefined names
flake8
- name: Test conda install
if: matrix.os == 'macos-latest'
- name: Test import xspec
if: matrix.os != 'macos-latest'
shell: bash -l {0}
run: python -m pytest -vv --cov=astromodels --cov-report=xml
env:
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 1
NUMEXPR_NUM_THREADS: 1
MPLBACKEND: "Agg"
- name: Test conda install
if: matrix.os != 'macos-latest'
run: python -c "import astromodels.xspec"
- name: Test astromodels
shell: bash -l {0}
run: |
echo "======> importing XSPEC..."
python -c "import astromodels.xspec"
python -m pytest -vv --cov=astromodels --cov-report=xml
run: python -m pytest -vv --cov=astromodels --cov-report=xml
env:
OMP_NUM_THREADS: 1
MKL_NUM_THREADS: 1
Expand Down

0 comments on commit 138a525

Please sign in to comment.