Skip to content

Commit

Permalink
split test files
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoRenaud committed Dec 5, 2024
1 parent 6013702 commit 3c7a432
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ on: [push]

jobs:
build:
name: build and test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: build and test
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
python-version: [3.8]
version: [3.8, 3.10]

steps:
- name: Cancel Previous Runs
Expand All @@ -20,20 +19,17 @@ jobs:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
uses: s-weigand/setup-conda@v1
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test
auto-activate-base: false
update-conda: true
python-version: ${{ matrix.version }}
conda-channels: anaconda
- name: Install essential
run: |
sudo apt update
sudo apt install build-essential
- name: Install conda packages
run: |
conda activate test
conda install -c anaconda cmake
conda install mpi4py h5py pytorch==2.0.0 torchvision==0.15.0 cpuonly -c pytorch -c conda-forge
conda install -c conda-forge libstdcxx-ng
Expand Down Expand Up @@ -63,7 +59,7 @@ jobs:
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
COVERALLS_FLAG_NAME: python-${{ matrix.version }}
COVERALLS_PARALLEL: true

finish:
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/build_osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: build_OSX

on: [push]

jobs:
build:
name: build and test on mac os
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
version: [3.8, 3.10]
include:
- os: macos-latest
CONDA_OS: osx-64

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ matrix.version }}
conda-channels: anaconda

- name: Install conda packages
run: |
conda install -c anaconda cmake
conda install mpi4py h5py pytorch==2.0.0 torchvision==0.15.0 cpuonly -c pytorch -c conda-forge
conda install -c conda-forge libstdcxx-ng
conda install -c anaconda gxx_linux-64
- name: Install the package
run: python -m pip install .[test,hpc]


- name: Test with single thread
env:
CONDA_PREFIX: /usr/share/miniconda
run: coverage run -m pytest tests

- name: Combine all coverage results
run: coverage combine

- run: coverage report

- name: Coveralls Parallel
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_FLAG_NAME: python-${{ matrix.version }}
COVERALLS_PARALLEL: true

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true

0 comments on commit 3c7a432

Please sign in to comment.