|
@@ -0,0 +1,70 @@
|
|
|
+name: pytest
|
|
|
+
|
|
|
+on:
|
|
|
+ - push
|
|
|
+ - pull_request
|
|
|
+
|
|
|
+jobs:
|
|
|
+ pytest:
|
|
|
+ strategy:
|
|
|
+ matrix:
|
|
|
+ os:
|
|
|
+ - ubuntu-20.04
|
|
|
+ python-version:
|
|
|
+ - "3.8"
|
|
|
+ - "3.10"
|
|
|
+ fail-fast: true
|
|
|
+
|
|
|
+ runs-on: ${{ matrix.os }}
|
|
|
+
|
|
|
+ steps:
|
|
|
+ - uses: actions/checkout@v2
|
|
|
+
|
|
|
+ - name: Set up Python
|
|
|
+ uses: actions/setup-python@v2
|
|
|
+ with:
|
|
|
+ python-version: ${{ matrix.python-version }}
|
|
|
+
|
|
|
+ - name: Install non-Python dependencies
|
|
|
+ run: |
|
|
|
+ sudo apt-get update -y
|
|
|
+ sudo apt-get install -y wget git gawk findutils
|
|
|
+ xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
|
|
|
+ sudo apt-get install -y --no-install-recommends --no-install-suggests
|
|
|
+
|
|
|
+ - name: Install Python dependencies
|
|
|
+ run: |
|
|
|
+ python -m pip install --upgrade pip
|
|
|
+ pip install -r .github/workflows/python_requirements.txt
|
|
|
+ pip install pytest
|
|
|
+
|
|
|
+ - name: Create installation directory
|
|
|
+ run: |
|
|
|
+ mkdir $HOME/install
|
|
|
+
|
|
|
+ - name: Set number of cores for compilation
|
|
|
+ run: |
|
|
|
+ echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
|
|
|
+
|
|
|
+ - name: Set LD_LIBRARY_PATH for compilation
|
|
|
+ run: |
|
|
|
+ echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
|
|
|
+
|
|
|
+ - name: Build
|
|
|
+ run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install
|
|
|
+
|
|
|
+ - name: Add the bin directory to PATH
|
|
|
+ run: |
|
|
|
+ echo "$HOME/install/bin" >> $GITHUB_PATH
|
|
|
+
|
|
|
+ - name: Test executing of the grass command
|
|
|
+ run: .github/workflows/test_simple.sh
|
|
|
+
|
|
|
+ - name: Run pytest
|
|
|
+ run: |
|
|
|
+ export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
|
|
|
+ pytest .
|
|
|
+
|
|
|
+ - name: Print installed versions
|
|
|
+ if: always()
|
|
|
+ run: .github/workflows/print_versions.sh
|