|
| 1 | +name: pyGIMLi CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - dev |
| 10 | + |
| 11 | +jobs: |
| 12 | + pgcore: |
| 13 | + name: Building pgcore & bindings |
| 14 | + runs-on: self-hosted |
| 15 | + steps: |
| 16 | + - name: Clean-up |
| 17 | + run: rm -rf ~/.cache/pygimli |
| 18 | + - name: Getting pyGIMLi sources |
| 19 | + uses: actions/checkout@v4 |
| 20 | + with: |
| 21 | + fetch-depth: 0 # checks out all branches and tags |
| 22 | + path: source |
| 23 | + - name: Running cmake |
| 24 | + run: | |
| 25 | + mkdir -p build |
| 26 | + cd build |
| 27 | + CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake ../source |
| 28 | + - name: Build libgimli |
| 29 | + run: make -j 8 gimli |
| 30 | + working-directory: build |
| 31 | + - name: Build Python bindings |
| 32 | + run: make pygimli J=4 |
| 33 | + working-directory: build |
| 34 | + pgtest: |
| 35 | + name: Running tests |
| 36 | + runs-on: self-hosted |
| 37 | + needs: pgcore |
| 38 | + env: |
| 39 | + OPENBLAS_CORETYPE: "ARMV8" # current bug in OpenBlas core detection |
| 40 | + steps: |
| 41 | + - name: Run pg.test() |
| 42 | + run: python3 -c "import pygimli; pygimli.test(show=False)" |
| 43 | + working-directory: source |
| 44 | + - name: Install as development package |
| 45 | + working-directory: source |
| 46 | + run: pip install -e . --break-system-packages --user # better to use virtual enviroment in the future |
| 47 | + docs: |
| 48 | + name: Build website with examples |
| 49 | + needs: pgtest |
| 50 | + runs-on: self-hosted |
| 51 | + env: |
| 52 | + DISPLAY: ":99.0" |
| 53 | + PYVISTA_OFF_SCREEN: True |
| 54 | + OPENBLAS_CORETYPE: "ARMV8" # current bug in OpenBlas core detection |
| 55 | + steps: |
| 56 | + - name: Clean gallery |
| 57 | + working-directory: build |
| 58 | + run: make clean-gallery |
| 59 | + - name: Running sphinx |
| 60 | + working-directory: build |
| 61 | + run: xvfb-run make doc # xvfb is necessary for headless display of pyvista plots |
| 62 | + merging: |
| 63 | + name: Merging dev into master |
| 64 | + runs-on: self-hosted |
| 65 | + needs: docs |
| 66 | + if: github.ref == 'refs/heads/dev' # Only merge from dev |
| 67 | + steps: |
| 68 | + - name: Merge into master |
| 69 | + uses: devmasx/merge-branch@master |
| 70 | + with: |
| 71 | + type: now |
| 72 | + target_branch: master |
| 73 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 74 | + upload-html: |
| 75 | + name: Upload HTML to dev.pygimli.org |
| 76 | + runs-on: self-hosted |
| 77 | + needs: docs |
| 78 | + if: github.ref == 'refs/heads/dev' # Only merge from dev |
| 79 | + steps: |
| 80 | + - name: Merge into master |
| 81 | + working-directory: build |
| 82 | + run: rsync -avP --delete doc/html/ /var/www/html |
| 83 | + |
| 84 | + |
0 commit comments