From fe78ec494ffa48d3e12a293b2357561849281556 Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Fri, 28 May 2021 17:04:54 +0200
Subject: [PATCH] CI: use shared prepare and build steps

---
 .github/workflows/push.yml | 55 +++++---------------------------------
 1 file changed, 6 insertions(+), 49 deletions(-)

diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index 89fbf91b6..23d4b91e2 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -28,55 +28,12 @@ jobs:
       options: --tmpfs /build:rw --user 0:0
     steps:
       - name: "prepare env"
-        run: |
-          sudo apt-get update
-          sudo apt-get -y install git-core jq
-          sudo apt-get -y install \
-            build-essential \
-            cmake \
-            extra-cmake-modules \
-            gettext \
-            kio-dev \
-            libatasmart-dev \
-            libboost-python-dev \
-            libkf5config-dev \
-            libkf5coreaddons-dev \
-            libkf5i18n-dev \
-            libkf5iconthemes-dev \
-            libkf5parts-dev \
-            libkf5service-dev \
-            libkf5solid-dev \
-            libkpmcore-dev \
-            libparted-dev \
-            libpolkit-qt5-1-dev \
-            libqt5svg5-dev \
-            libqt5webkit5-dev \
-            libyaml-cpp-dev \
-            os-prober \
-            pkg-config \
-            python3-dev \
-            qtbase5-dev \
-            qtdeclarative5-dev \
-            qttools5-dev \
-            qttools5-dev-tools
+        uses: calamares/actions/prepare-neon@v2
       - name: "prepare source"
         uses: actions/checkout@v2
-      - name: "prepare build"
-        id: pre_build
-        run: |
-          test -n "$BUILDDIR" || { echo "! \$BUILDDIR not set" ; exit 1 ; }
-          mkdir -p $BUILDDIR
-          test -f $SRCDIR/CMakeLists.txt || { echo "! Missing $SRCDIR/CMakeLists.txt" ; exit 1 ; }
-          echo "::set-output name=message::"`git log -1 --abbrev-commit --pretty=oneline --no-decorate ${{ github.event.head_commit.id }}`
-      - name: "Calamares: cmake"
-        working-directory: ${{ env.BUILDDIR }}
-        run: cmake $CMAKE_ARGS $SRCDIR
-      - name: "Calamares: make"
-        working-directory: ${{ env.BUILDDIR }}
-        run: make -j2 VERBOSE=1
-      - name: "Calamares: install"
-        working-directory: ${{ env.BUILDDIR }}
-        run: make install VERBOSE=1
+      - name: "build"
+        id: build
+        uses: calamares/actions/generic-build@v2
       - name: "notify: ok"
         if: ${{ success() && github.repository == 'calamares/calamares' }}
         uses: calamares/actions/matrix-notify@v1
@@ -85,7 +42,7 @@ jobs:
           room: ${{ secrets.MATRIX_ROOM }}
           message: |
             OK ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
-            .. ${{ steps.pre_build.outputs.message }}
+            .. ${{ steps.build.outputs.git-summary }}
       - name: "notify: fail"
         if: ${{ failure() && github.repository == 'calamares/calamares' }}
         uses: calamares/actions/matrix-notify@v1
@@ -94,5 +51,5 @@ jobs:
           room: ${{ secrets.MATRIX_ROOM }}
           message: |
             FAIL ${{ github.workflow }} in ${{ github.repository }} by ${{ github.actor }} on ${{ github.event.ref }}
-              .. ${{ steps.pre_build.outputs.message }}
+              .. ${{ steps.build.outputs.git-summary }}
               .. ${{ github.event.compare }}