|
| 1 | +name: Build and Test |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: ['**'] |
| 6 | + push: |
| 7 | + branches: ['master', 'develop', 'release/*'] |
| 8 | + tags: [v*] |
| 9 | + release: |
| 10 | + types: [published] |
| 11 | + |
| 12 | +jobs: |
| 13 | + build: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + container: |
| 16 | + image: s22s/circleci-openjdk-conda-gdal:b8e30ee |
| 17 | + |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + - uses: coursier/cache-action@v6 |
| 23 | + - uses: olafurpg/setup-scala@v13 |
| 24 | + with: |
| 25 | + |
| 26 | + |
| 27 | + - name: Set up Python 3.8 |
| 28 | + uses: actions/setup-python@v2 |
| 29 | + with: |
| 30 | + python-version: 3.8 |
| 31 | + |
| 32 | + - name: Install Conda dependencies |
| 33 | + run: | |
| 34 | + # $CONDA is an environment variable pointing to the root of the miniconda directory |
| 35 | + $CONDA/bin/conda install -c conda-forge --yes --file pyrasterframes/src/main/python/requirements-condaforge.txt |
| 36 | +
|
| 37 | + - run: ulimit -c unlimited -S |
| 38 | + |
| 39 | + # Do just the compilation stage to minimize sbt memory footprint |
| 40 | + - name: Compile |
| 41 | + run: sbt -v -batch compile test:compile it:compile |
| 42 | + |
| 43 | + - name: Core tests |
| 44 | + run: sbt -batch core/test |
| 45 | + |
| 46 | + - name: Datasource tests |
| 47 | + run: sbt -batch datasource/test |
| 48 | + |
| 49 | + - name: Experimental tests |
| 50 | + run: sbt -batch experimental/test |
| 51 | + |
| 52 | + - name: Create PyRasterFrames package |
| 53 | + run: sbt -v -batch pyrasterframes/package |
| 54 | + |
| 55 | + - name: Python tests |
| 56 | + run: sbt -batch pyrasterframes/test |
| 57 | + |
| 58 | + - name: Collect artifacts |
| 59 | + if: ${{ failure() }} |
| 60 | + run: | |
| 61 | + mkdir -p /tmp/core_dumps |
| 62 | + ls -lh /tmp |
| 63 | + cp core.* *.hs /tmp/core_dumps/ 2> /dev/null || true |
| 64 | + cp ./core/*.log /tmp/core_dumps/ 2> /dev/null || true |
| 65 | + cp -r /tmp/hsperfdata* /tmp/*.hprof /tmp/core_dumps/ 2> /dev/null || true |
| 66 | + cp repo/core/core/* /tmp/core_dumps/ 2> /dev/null || true |
| 67 | +
|
| 68 | + - name: Upload core dumps |
| 69 | + if: ${{ failure() }} |
| 70 | + uses: actions/upload-artifact@v2 |
| 71 | + with: |
| 72 | + name: core-dumps |
| 73 | + path: /tmp/core_dumps |
| 74 | + |
| 75 | + docs: |
| 76 | + runs-on: ubuntu-latest |
| 77 | + container: |
| 78 | + image: s22s/circleci-openjdk-conda-gdal:b8e30ee |
| 79 | + |
| 80 | + steps: |
| 81 | + - uses: actions/checkout@v2 |
| 82 | + with: |
| 83 | + fetch-depth: 0 |
| 84 | + - uses: coursier/cache-action@v6 |
| 85 | + - uses: olafurpg/setup-scala@v13 |
| 86 | + with: |
| 87 | + |
| 88 | + |
| 89 | + - name: Set up Python 3.8 |
| 90 | + uses: actions/setup-python@v2 |
| 91 | + with: |
| 92 | + python-version: 3.8 |
| 93 | + |
| 94 | + - name: Install Conda dependencies |
| 95 | + run: | |
| 96 | + # $CONDA is an environment variable pointing to the root of the miniconda directory |
| 97 | + $CONDA/bin/conda install -c conda-forge --yes --file pyrasterframes/src/main/python/requirements-condaforge.txt |
| 98 | +
|
| 99 | + - run: ulimit -c unlimited -S |
| 100 | + |
| 101 | + - name: Build documentation |
| 102 | + run: sbt makeSite |
| 103 | + |
| 104 | + - name: Collect artifacts |
| 105 | + if: ${{ failure() }} |
| 106 | + run: | |
| 107 | + mkdir -p /tmp/core_dumps |
| 108 | + cp core.* *.hs /tmp/core_dumps 2> /dev/null || true |
| 109 | + mkdir -p /tmp/markdown |
| 110 | + cp pyrasterframes/target/python/docs/*.md /tmp/markdown 2> /dev/null || true |
| 111 | +
|
| 112 | + - name: Upload core dumps |
| 113 | + if: ${{ failure() }} |
| 114 | + uses: actions/upload-artifact@v2 |
| 115 | + with: |
| 116 | + name: core-dumps |
| 117 | + path: /tmp/core_dumps |
| 118 | + |
| 119 | + - name: Upload markdown |
| 120 | + if: ${{ failure() }} |
| 121 | + uses: actions/upload-artifact@v2 |
| 122 | + with: |
| 123 | + name: markdown |
| 124 | + path: /tmp/markdown |
| 125 | + |
| 126 | + - name: Upload rf-site |
| 127 | + if: ${{ failure() }} |
| 128 | + uses: actions/upload-artifact@v2 |
| 129 | + with: |
| 130 | + name: rf-site |
| 131 | + path: docs/target/site |
0 commit comments