Skip to content

Continuous integration

pellem_m edited this page Jun 24, 2024 · 11 revisions

Continuous Integration

In order for OpenAlea to work, we need to test the entire build each time a commit is done. To do that we use Continuous Integration (CI) tools :

  • GitHub Actions for automated tests on UNIX, MacOS, and Windows systems.

These tools will do automated tests before each commit, and inform us if something is not working.

GitHub Actions:

GitHub Actions allows for CI/CD directly from your GitHub repository. Below is an example configuration file for setting up CI with GitHub Actions, specifically using conda to manage dependencies and build packages.

You can find the github action we use for our packages here:

Example GitHub Actions Configuration

Here’s an example configuration file for setting up CI with GitHub Actions, specifically using conda to manage dependencies and build packages.

Example .github/workflows/conda-package-build.yml

name: Conda Package Build

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        python-version: [3.7, 3.8, 3.9, 3.10]

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install conda
      uses: conda-incubator/setup-miniconda@v2
      with:
        auto-update-conda: true
        activate-environment: test
        python-version: ${{ matrix.python-version }}
        environment-file: environment.yml
        cache-builds: true

    - name: Build the package
      run: |
        conda install conda-build
        conda build .

    - name: Test the package
      run: |
        conda install --use-local openalea.mtg
        pytest
Clone this wiki locally