Bläddra i källkod

Format YAML in GH workflows (#1367)

Apply consistent formatting to YAML files in GitHub workflows.
Using the defaults for yamllint, i.e., 2 spaces and indenting lists.
Applied using Mega-Linter (prettier, yamllint).
Vaclav Petras 4 år sedan
förälder
incheckning
567fa0643d

+ 18 - 20
.github/workflows/black.yml

@@ -1,11 +1,10 @@
 name: Python Black Formatting
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
-
   run-black:
     name: ${{ matrix.directory }}
     runs-on: ubuntu-20.04
@@ -19,20 +18,19 @@ jobs:
       fail-fast: false
 
     steps:
-
-    - uses: actions/checkout@v2
-
-    - name: Set up Python
-      uses: actions/setup-python@v2
-      with:
-        python-version: 3.8
-
-    - name: Install
-      run: |
-        python -m pip install --upgrade pip
-        pip install black==20.8b1
-
-    - name: Run Black
-      run: |
-        cd ${{ matrix.directory }}
-        black --check --diff .
+      - uses: actions/checkout@v2
+
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install
+        run: |
+          python -m pip install --upgrade pip
+          pip install black==20.8b1
+
+      - name: Run Black
+        run: |
+          cd ${{ matrix.directory }}
+          black --check --diff .

+ 42 - 42
.github/workflows/centos.yml

@@ -1,8 +1,8 @@
 name: CentOS
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
   build:
@@ -13,46 +13,46 @@ jobs:
     strategy:
       matrix:
         os:
-        - centos:7
+          - centos:7
       fail-fast: false
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Get dependencies
-      run: |
-        yum install -y epel-release
-        yum install -y wget gawk
-        yum install -y $(cat .github/workflows/yum.txt)
-    - name: Install conda
-      run: |
-        wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
-        chmod u+x Anaconda3-2020.02-Linux-x86_64.sh
-        ./Anaconda3-2020.02-Linux-x86_64.sh -b
-    - name: Set variables with conda executable and activate
-      run: |
-        echo "CONDA=/github/home/anaconda3/bin/conda" >> $GITHUB_ENV
-        echo "CONDA_ACTIVATE=/github/home/anaconda3/bin/activate" >> $GITHUB_ENV
-    - name: Get GRASS GIS runtime conda dependencies
-      run: |
-        source $CONDA_ACTIVATE
-        $CONDA install -y -c anaconda numpy wxpython python-dateutil ply termcolor
-    - 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: |
-        source $CONDA_ACTIVATE
-        .github/workflows/build_centos.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: |
-        source $CONDA_ACTIVATE
-        .github/workflows/test_simple.sh
+      - uses: actions/checkout@v2
+      - name: Get dependencies
+        run: |
+          yum install -y epel-release
+          yum install -y wget gawk
+          yum install -y $(cat .github/workflows/yum.txt)
+      - name: Install conda
+        run: |
+          wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
+          chmod u+x Anaconda3-2020.02-Linux-x86_64.sh
+          ./Anaconda3-2020.02-Linux-x86_64.sh -b
+      - name: Set variables with conda executable and activate
+        run: |
+          echo "CONDA=/github/home/anaconda3/bin/conda" >> $GITHUB_ENV
+          echo "CONDA_ACTIVATE=/github/home/anaconda3/bin/activate" >> $GITHUB_ENV
+      - name: Get GRASS GIS runtime conda dependencies
+        run: |
+          source $CONDA_ACTIVATE
+          $CONDA install -y -c anaconda numpy wxpython python-dateutil ply termcolor
+      - 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: |
+          source $CONDA_ACTIVATE
+          .github/workflows/build_centos.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: |
+          source $CONDA_ACTIVATE
+          .github/workflows/test_simple.sh

+ 55 - 55
.github/workflows/ci.yml

@@ -1,8 +1,8 @@
 name: CI
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
   build:
@@ -12,29 +12,29 @@ jobs:
     strategy:
       matrix:
         os:
-        - ubuntu-18.04
-        - ubuntu-20.04
+          - ubuntu-18.04
+          - ubuntu-20.04
       fail-fast: false
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Get 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: Create installation directory
-      run: |
-        mkdir $HOME/install
-    - name: Ensure one core for compilation
-      run: |
-        echo "MAKEFLAGS=-j1" >> $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.sh $HOME/install
+      - uses: actions/checkout@v2
+      - name: Get 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: Create installation directory
+        run: |
+          mkdir $HOME/install
+      - name: Ensure one core for compilation
+        run: |
+          echo "MAKEFLAGS=-j1" >> $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.sh $HOME/install
 
   test:
     name: ${{ matrix.os }} tests
@@ -43,40 +43,40 @@ jobs:
     strategy:
       matrix:
         os:
-        - ubuntu-18.04
-        - ubuntu-20.04
+          - ubuntu-18.04
+          - ubuntu-20.04
       fail-fast: false
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Get 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: 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.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 tests
-      run: .github/workflows/test_thorough.sh
+      - uses: actions/checkout@v2
+      - name: Get 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: 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.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 tests
+        run: .github/workflows/test_thorough.sh
 
-    - name: Make HTML test report available
-      uses: actions/upload-artifact@v2
-      with:
-        name: testreport-${{ matrix.os }}
-        path: testreport
-        retention-days: 3
+      - name: Make HTML test report available
+        uses: actions/upload-artifact@v2
+        with:
+          name: testreport-${{ matrix.os }}
+          path: testreport
+          retention-days: 3

+ 37 - 35
.github/workflows/codeql-analysis.yml

@@ -2,12 +2,12 @@ name: "CodeQL"
 
 on:
   push:
-    branches: [ master,  releasebranch_7_8]
+    branches: [master, releasebranch_7_8]
   pull_request:
-    branches: [ master ]
+    branches: [master]
   schedule:
     # Check every Saturday at 18:36
-    - cron: '36 18 * * 6'
+    - cron: "36 18 * * 6"
 
 jobs:
   analyze:
@@ -18,37 +18,39 @@ jobs:
       fail-fast: false
       matrix:
         # C is included in cpp, no separate C language available on CodeQL
-        language: [ 'cpp', 'python' ]
+        language:
+          - cpp
+          - python
 
     steps:
-    - name: Checkout repository
-      uses: actions/checkout@v2
-
-    - name: Initialize CodeQL
-      uses: github/codeql-action/init@v1
-      with:
-        languages: ${{ matrix.language }}
-
-    - name: Get 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: Create installation directory
-      run: |
-        mkdir $HOME/install
-
-    - name: Set LD_LIBRARY_PATH for compilation
-      run: |
-        echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
-
-    - name: Build
-      env:
-        CFLAGS: "-std=gnu11"
-        CXXFLAGS: "-std=c++11"
-      run: .github/workflows/build.sh $HOME/install
-
-    - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v1
+      - name: Checkout repository
+        uses: actions/checkout@v2
+
+      - name: Initialize CodeQL
+        uses: github/codeql-action/init@v1
+        with:
+          languages: ${{ matrix.language }}
+
+      - name: Get 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: Create installation directory
+        run: |
+          mkdir $HOME/install
+
+      - name: Set LD_LIBRARY_PATH for compilation
+        run: |
+          echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
+
+      - name: Build
+        env:
+          CFLAGS: "-std=gnu11"
+          CXXFLAGS: "-std=c++11"
+        run: .github/workflows/build.sh $HOME/install
+
+      - name: Perform CodeQL Analysis
+        uses: github/codeql-action/analyze@v1

+ 23 - 25
.github/workflows/flake8.yml

@@ -1,39 +1,37 @@
 name: Python Flake8 Code Quality
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
-
   flake8:
     name: ${{ matrix.directory }}
     runs-on: ubuntu-20.04
     strategy:
       matrix:
         directory:
-        - gui/wxpython
-        - python/grass
-        - lib/init
-        - scripts
-        - temporal
+          - gui/wxpython
+          - lib/init
+          - python/grass
+          - scripts
+          - temporal
       fail-fast: false
 
     steps:
-
-    - uses: actions/checkout@v2
-
-    - name: Set up Python
-      uses: actions/setup-python@v2
-      with:
-        python-version: 3.8
-
-    - name: Install
-      run: |
-        python -m pip install --upgrade pip
-        pip install flake8==3.8.4
-
-    - name: Run Flake8
-      run: |
-        cd ${{ matrix.directory }}
-        flake8 --count --statistics --show-source --jobs=$(nproc) .
+      - uses: actions/checkout@v2
+
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+
+      - name: Install
+        run: |
+          python -m pip install --upgrade pip
+          pip install flake8==3.8.4
+
+      - name: Run Flake8
+        run: |
+          cd ${{ matrix.directory }}
+          flake8 --count --statistics --show-source --jobs=$(nproc) .

+ 33 - 33
.github/workflows/gcc.yml

@@ -1,8 +1,8 @@
 name: GCC C/C++ standards check
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
   build:
@@ -12,37 +12,37 @@ jobs:
     strategy:
       matrix:
         include:
-        - c: gnu99
-          cpp: c++11
-        - c: gnu11
-          cpp: c++11
-        - c: gnu11
-          cpp: c++14
-        - c: gnu17
-          cpp: c++17
+          - c: gnu99
+            cpp: c++11
+          - c: gnu11
+            cpp: c++11
+          - c: gnu11
+            cpp: c++14
+          - c: gnu17
+            cpp: c++17
       fail-fast: false
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Get 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: Create installation directory
-      run: |
-        mkdir $HOME/install
-    - name: Ensure one core for compilation
-      run: |
-        echo "MAKEFLAGS=-j1" >> $GITHUB_ENV
-    - name: Set LD_LIBRARY_PATH for compilation
-      run: |
-        echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
-    - name: Build
-      env:
-        # TODO: -pedantic-errors here won't go through ./configure (with GNU C)
-        CFLAGS: "-std=${{ matrix.c }}"
-        # TODO: -pedantic-errors here won't compile
-        CXXFLAGS: "-std=${{ matrix.cpp }}"
-      run: .github/workflows/build.sh $HOME/install
+      - uses: actions/checkout@v2
+      - name: Get 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: Create installation directory
+        run: |
+          mkdir $HOME/install
+      - name: Ensure one core for compilation
+        run: |
+          echo "MAKEFLAGS=-j1" >> $GITHUB_ENV
+      - name: Set LD_LIBRARY_PATH for compilation
+        run: |
+          echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
+      - name: Build
+        env:
+          # TODO: -pedantic-errors here won't go through ./configure (with GNU C)
+          CFLAGS: "-std=${{ matrix.c }}"
+          # TODO: -pedantic-errors here won't compile
+          CXXFLAGS: "-std=${{ matrix.cpp }}"
+        run: .github/workflows/build.sh $HOME/install

+ 22 - 22
.github/workflows/osgeo4w.yml

@@ -1,8 +1,8 @@
 name: OSGeo4W
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
   build:
@@ -12,26 +12,26 @@ jobs:
     strategy:
       matrix:
         os:
-        - windows-2019
+          - windows-2019
       fail-fast: false
 
     steps:
-    - name: Set git to use LF
-      run: |
-        git config --global core.autocrlf false
-        git config --global core.eol lf
-    - uses: actions/checkout@v2
-    - name: Install OSGeo4W
-      run: |
-        $exe = 'osgeo4w-setup-x86_64.exe'
-        $url = 'http://download.osgeo.org/osgeo4w/' + $exe
-        (New-Object System.Net.WebClient).DownloadFile($url, $exe)
-        Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait
-    - name: Install MSYS2 packages
-      run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six
-    - name: Compile GRASS GIS
-      run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location)
-    - name: Test executing of the grass command
-      run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass\grass79.bat'
-    - name: Run tests
-      run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass\grass79.bat'
+      - name: Set git to use LF
+        run: |
+          git config --global core.autocrlf false
+          git config --global core.eol lf
+      - uses: actions/checkout@v2
+      - name: Install OSGeo4W
+        run: |
+          $exe = 'osgeo4w-setup-x86_64.exe'
+          $url = 'http://download.osgeo.org/osgeo4w/' + $exe
+          (New-Object System.Net.WebClient).DownloadFile($url, $exe)
+          Start-Process ('.\'+$exe) -ArgumentList '-A -g -k -q -s http://download.osgeo.org/x86_64 -P cairo,fftw,freetype-devel,gdal-ecw,gdal-mrsid,liblas-devel,libxdr,msys,pdcurses,python3-numpy,python3-pywin32,python3-wx,regex-devel,wxpython,zstd-devel' -Wait
+      - name: Install MSYS2 packages
+        run: C:\msys64\usr\bin\pacman.exe --noconfirm -S tar libintl make bison diffutils git dos2unix zip mingw-w64-x86_64-toolchain mingw-w64-x86_64-cairo mingw-w64-x86_64-python3-six
+      - name: Compile GRASS GIS
+        run: C:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') -p (Get-Location)
+      - name: Test executing of the grass command
+        run: .github/workflows/test_simple.bat 'C:\OSGeo4W64\opt\grass\grass79.bat'
+      - name: Run tests
+        run: .github/workflows/test_thorough.bat 'C:\OSGeo4W64\opt\grass\grass79.bat'

+ 21 - 23
.github/workflows/super-linter.yml

@@ -1,34 +1,32 @@
 name: General linting
 
 on:
-- push
-- pull_request
+  - push
+  - pull_request
 
 jobs:
-
   super-linter:
-
     name: GitHub Super Linter
 
     runs-on: ubuntu-latest
 
     steps:
-    - uses: actions/checkout@v2
-    -  name: Lint code base
-       uses: docker://github/super-linter:v2.2.2
-       env:
-         # Listed but disabled linters would be nice to have.
-         # Python (supported using Pylint) and C/C++ (not supported) are
-         # handled separately due to the complexity of the settings.
-         # (The rest is simply disabled automatically as of v2.)
-         VALIDATE_BASH: false
-         VALIDATE_CSS: false
-         VALIDATE_DOCKER: false
-         VALIDATE_JAVASCRIPT_ES: true
-         VALIDATE_JAVASCRIPT_STANDARD: false
-         VALIDATE_JSON: true
-         VALIDATE_MD: false
-         VALIDATE_PERL: false
-         VALIDATE_POWERSHELL: true
-         VALIDATE_XML: true
-         VALIDATE_YAML: true
+      - uses: actions/checkout@v2
+      - name: Lint code base
+        uses: docker://github/super-linter:v2.2.2
+        env:
+          # Listed but disabled linters would be nice to have.
+          # Python (supported using Pylint) and C/C++ (not supported) are
+          # handled separately due to the complexity of the settings.
+          # (The rest is simply disabled automatically as of v2.)
+          VALIDATE_BASH: false
+          VALIDATE_CSS: false
+          VALIDATE_DOCKER: false
+          VALIDATE_JAVASCRIPT_ES: true
+          VALIDATE_JAVASCRIPT_STANDARD: false
+          VALIDATE_JSON: true
+          VALIDATE_MD: false
+          VALIDATE_PERL: false
+          VALIDATE_POWERSHELL: true
+          VALIDATE_XML: true
+          VALIDATE_YAML: true