Skip to content

Commit

Permalink
Merge pull request #251 from AdvancedPhotonSource/ci
Browse files Browse the repository at this point in the history
CI: Migrate unit tests to actions from azure
  • Loading branch information
carterbox committed Jan 19, 2023
2 parents 462c5e0 + 1d6f5b7 commit beb7074
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 139 deletions.
121 changes: 121 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Run unit tests

on:
push:
branches:
- main
paths:
- "tests/**"
- "src/tike/**"
- pyproject.toml
pull_request:
branches:
- main
paths:
- "tests/**"
- "src/tike/**"
- pyproject.toml

jobs:
linux-x86-no-mpi:
runs-on: self-hosted

strategy:
matrix:
python-version:
- "3.10"
- "3.7"
- "3.9"

steps:
- uses: actions/checkout@v3

- run: >
conda create --quiet --yes
-n tike
--channel conda-forge
--file requirements.txt
pytest
python=${{ matrix.python-version }}
'openmpi=*=h*'
name: Create build environment
- run: conda remove -n tike mpi mpi4py --yes --quiet
name: Remove MPI from test environment

- run: conda list -n tike
name: List build environment

- run: |
source activate tike
pip install . --no-deps
name: Setup and install
- run: |
source activate tike
python tests/print-gpu-info.py
name: Print GPU info
- run: |
source activate tike
export TIKE_TEST_CI
pytest -vs tests
name: Run tests
- uses: actions/upload-artifact@v3
if: ${{ python-version == '3.9' }}
with:
path: tests/result/
name: Without MPI reconstructed images

- run: conda remove -n tike --all
name: Clean up environment

linux-x86-with-mpi:
runs-on: self-hosted

strategy:
matrix:
python-version:
- "3.8"

steps:
- uses: actions/checkout@v3

- run: >
conda create --quiet --yes
-n tike
--channel conda-forge
--file requirements.txt
pytest
python=${{ matrix.python-version }}
'openmpi=*=h*'
name: Create build environment
- run: conda list -n tike
name: List build environment

- run: |
source activate tike
pip install . --no-deps
name: Setup and install
- run: |
source activate tike
python tests/print-gpu-info.py
name: Print GPU info
- run: |
source activate tike
export OMPI_MCA_opal_cuda_support=true
export TIKE_TEST_CI
mpirun -n 2 pytest -vs tests
name: Run tests with MPI
- uses: actions/upload-artifact@v3
with:
path: tests/result/
name: MPI reconstructed images

- run: conda remove -n tike --all
name: Clean up environment
139 changes: 0 additions & 139 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit beb7074

Please sign in to comment.