Procházet zdrojové kódy

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 před 3 roky
rodič
revize
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:
           CFLAGS: "-std=gnu11"
           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
         uses: github/codeql-action/analyze@v1

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

@@ -45,4 +45,4 @@ jobs:
           CFLAGS: "-std=${{ matrix.c }}"
           # TODO: -pedantic-errors here won't compile
           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:
   - push
   - pull_request
 
 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
 
     runs-on: ${{ matrix.os }}
@@ -43,32 +14,41 @@ jobs:
       matrix:
         os:
           - 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_ubuntu18.sh $HOME/install
+        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 tests
         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)
 [![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)
-[![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)
-[![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