Просмотр исходного кода

ci: Remove duplication in Ubuntu workflow, keep test job only (#1749)

Remove duplication introduced with PDAL: matrix.os has the name of the the system which is used in the YAML.
This basically returns the CI YAML files state to what it was before the change, but
keeping the addition of a new build script and version-specific naming for the scripts.

Remove the separate Ubuntu build, keep only the test job, rename CI to Ubuntu.
There is no need for a separate build anymore since GCC workflows now do that.

Additionally, fix CentOS label, add empty lines between list items (maybe helpful; allowed by prettier).
Vaclav Petras 3 лет назад
Родитель
Сommit
b77880d09f

.github/workflows/build_ubuntu18.sh → .github/workflows/build_ubuntu-18.04.sh


.github/workflows/build_ubuntu20.sh → .github/workflows/build_ubuntu-20.04.sh


+ 0 - 81
.github/workflows/ci_ubuntu20.yml

@@ -1,81 +0,0 @@
-name: Ubuntu20
-
-on:
-  - push
-  - pull_request
-
-jobs:
-  build:
-    name: ${{ matrix.os }} build
-
-    runs-on: ${{ matrix.os }}
-    strategy:
-      matrix:
-        os:
-          - 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_ubuntu20.sh $HOME/install
-
-  test:
-    name: ${{ matrix.os }} tests
-
-    runs-on: ${{ matrix.os }}
-    strategy:
-      matrix:
-        os:
-          - 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_ubuntu20.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
-        if: ${{ always() }}
-        uses: actions/upload-artifact@v2
-        with:
-          name: testreport-${{ matrix.os }}
-          path: testreport
-          retention-days: 3

+ 1 - 1
.github/workflows/codeql-analysis.yml

@@ -50,7 +50,7 @@ jobs:
         env:
         env:
           CFLAGS: "-std=gnu11"
           CFLAGS: "-std=gnu11"
           CXXFLAGS: "-std=c++11"
           CXXFLAGS: "-std=c++11"
-        run: .github/workflows/build_ubuntu20.sh $HOME/install
+        run: .github/workflows/build_ubuntu-20.04.sh $HOME/install
 
 
       - name: Perform CodeQL Analysis
       - name: Perform CodeQL Analysis
         uses: github/codeql-action/analyze@v1
         uses: github/codeql-action/analyze@v1

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

@@ -45,4 +45,4 @@ jobs:
           CFLAGS: "-std=${{ matrix.c }}"
           CFLAGS: "-std=${{ matrix.c }}"
           # TODO: -pedantic-errors here won't compile
           # TODO: -pedantic-errors here won't compile
           CXXFLAGS: "-std=${{ matrix.cpp }}"
           CXXFLAGS: "-std=${{ matrix.cpp }}"
-        run: .github/workflows/build_ubuntu20.sh $HOME/install
+        run: .github/workflows/build_ubuntu-20.04.sh $HOME/install

+ 13 - 33
.github/workflows/ci_ubuntu18.yml

@@ -1,41 +1,12 @@
-name: Ubuntu18
+name: Ubuntu
+# Build and run tests on Ubuntu
 
 
 on:
 on:
   - push
   - push
   - pull_request
   - pull_request
 
 
 jobs:
 jobs:
-  build:
-    name: ${{ matrix.os }} build
-
-    runs-on: ${{ matrix.os }}
-    strategy:
-      matrix:
-        os:
-          - ubuntu-18.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_ubuntu18.sh $HOME/install
-
-  test:
+  build-and-test:
     name: ${{ matrix.os }} tests
     name: ${{ matrix.os }} tests
 
 
     runs-on: ${{ matrix.os }}
     runs-on: ${{ matrix.os }}
@@ -43,32 +14,41 @@ jobs:
       matrix:
       matrix:
         os:
         os:
           - ubuntu-18.04
           - ubuntu-18.04
+          - ubuntu-20.04
       fail-fast: false
       fail-fast: false
 
 
     steps:
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
+
       - name: Get dependencies
       - name: Get dependencies
         run: |
         run: |
           sudo apt-get update -y
           sudo apt-get update -y
           sudo apt-get install -y wget git gawk findutils
           sudo apt-get install -y wget git gawk findutils
           xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
           xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
               sudo apt-get install -y --no-install-recommends --no-install-suggests
               sudo apt-get install -y --no-install-recommends --no-install-suggests
+
       - name: Create installation directory
       - name: Create installation directory
         run: |
         run: |
           mkdir $HOME/install
           mkdir $HOME/install
+
       - name: Set number of cores for compilation
       - name: Set number of cores for compilation
         run: |
         run: |
           echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
           echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
+
       - name: Set LD_LIBRARY_PATH for compilation
       - name: Set LD_LIBRARY_PATH for compilation
         run: |
         run: |
           echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
           echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
+
       - name: Build
       - name: Build
-        run: .github/workflows/build_ubuntu18.sh $HOME/install
+        run: .github/workflows/build_${{ matrix.os }}.sh $HOME/install
+
       - name: Add the bin directory to PATH
       - name: Add the bin directory to PATH
         run: |
         run: |
           echo "$HOME/install/bin" >> $GITHUB_PATH
           echo "$HOME/install/bin" >> $GITHUB_PATH
+
       - name: Test executing of the grass command
       - name: Test executing of the grass command
         run: .github/workflows/test_simple.sh
         run: .github/workflows/test_simple.sh
+
       - name: Run tests
       - name: Run tests
         run: .github/workflows/test_thorough.sh
         run: .github/workflows/test_thorough.sh
 
 

+ 2 - 2
README.md

@@ -2,9 +2,9 @@
 [![GCC C/C++ standards check](https://github.com/OSGeo/grass/workflows/GCC%20C/C++%20standards%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22GCC+C%2FC%2B%2B+standards+check%22)
 [![GCC C/C++ standards check](https://github.com/OSGeo/grass/workflows/GCC%20C/C++%20standards%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22GCC+C%2FC%2B%2B+standards+check%22)
 [![Python code quality check](https://github.com/OSGeo/grass/workflows/Python%20code%20quality%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22Python+code+quality+check%22)
 [![Python code quality check](https://github.com/OSGeo/grass/workflows/Python%20code%20quality%20check/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22Python+code+quality+check%22)
 [![General linting](https://github.com/OSGeo/grass/workflows/General%20linting/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22General+linting%22)
 [![General linting](https://github.com/OSGeo/grass/workflows/General%20linting/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3A%22General+linting%22)
-[![CI](https://github.com/OSGeo/grass/workflows/CI/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3ACI)
+[![Ubuntu](https://github.com/OSGeo/grass/workflows/Ubuntu/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3AUbuntu)
 [![OSGeo4W](https://github.com/OSGeo/grass/workflows/OSGeo4W/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3AOSGeo4W)
 [![OSGeo4W](https://github.com/OSGeo/grass/workflows/OSGeo4W/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3AOSGeo4W)
-[![Centos](https://github.com/OSGeo/grass/workflows/CentOS/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3ACentOS)
+[![CentOS](https://github.com/OSGeo/grass/workflows/CentOS/badge.svg)](https://github.com/OSGeo/grass/actions?query=workflow%3ACentOS)
 
 
 # GRASS GIS Repository
 # GRASS GIS Repository