|
| 1 | +name: BioNeuralNet CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 14 | + python-version: ["3.10", "3.11"] |
| 15 | + |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout repository |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Set up Python ${{ matrix.python-version }} |
| 23 | + uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + check-latest: true |
| 27 | + |
| 28 | + - name: Cache pip dependencies |
| 29 | + uses: actions/cache@v3 |
| 30 | + with: |
| 31 | + path: ~/.cache/pip |
| 32 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} |
| 33 | + restore-keys: ${{ runner.os }}-pip- |
| 34 | + |
| 35 | + - name: Install Python dependencies |
| 36 | + run: | |
| 37 | + python -m pip install --upgrade pip |
| 38 | + pip install -r requirements.txt |
| 39 | + pip install -r requirements-dev.txt |
| 40 | + pip install torch |
| 41 | + pip install torch_geometric |
| 42 | + shell: bash |
| 43 | + |
| 44 | + - name: Install R |
| 45 | + uses: r-lib/actions/setup-r@v2 |
| 46 | + with: |
| 47 | + r-version: "latest" |
| 48 | + |
| 49 | + - name: Install R packages |
| 50 | + run: | |
| 51 | + Rscript -e "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager', repos='https://cran.r-project.org')" |
| 52 | + Rscript -e "install.packages(c('dplyr', 'jsonlite'), repos='https://cran.r-project.org')" |
| 53 | + Rscript -e "BiocManager::install(c('impute', 'preprocessCore', 'GO.db', 'AnnotationDbi'), update=FALSE, ask=FALSE)" |
| 54 | + Rscript -e "install.packages('SmCCNet', repos='https://cran.r-project.org')" |
| 55 | + Rscript -e "install.packages('WGCNA', repos='https://cran.r-project.org')" |
| 56 | + shell: bash |
| 57 | + |
| 58 | + - name: Run tests with pytest |
| 59 | + run: | |
| 60 | + find . -name ".coverage*" -delete |
| 61 | + pytest --cov=bioneuralnet --cov-report=xml tests/ |
| 62 | +
|
| 63 | + - name: Upload coverage to Codecov |
| 64 | + uses: codecov/codecov-action@v3 |
| 65 | + with: |
| 66 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 67 | + files: ./coverage.xml |
| 68 | + flags: unittests |
| 69 | + name: codecov-umbrella |
0 commit comments