File 6112-gh-Add-test-for-compiling-all-flavors-and-types.patch of Package erlang

From 284d32462ce75cdee5d09371c1d05f0929098423 Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Tue, 4 Oct 2022 14:27:05 +0200
Subject: [PATCH 2/4] gh: Add test for compiling all flavors and types

---
 .github/workflows/main.yaml | 39 +++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 8a0e9b8a25..5c3d028b14 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -52,6 +52,45 @@ jobs:
           name: otp_git_archive
           path: otp_src.tar.gz
 
+  build-flavors:
+    name: Build Erlang/OTP (Types and Flavors)
+    runs-on: ubuntu-latest
+    needs: [pack, changed-apps]
+    if: contains(needs.changed-apps.outputs.changes, 'emulator')
+
+    steps:
+      - uses: actions/checkout@v2
+      ## Download docker images
+      - name: Cache BASE image
+        id: cache-base-image
+        uses: actions/cache@v3
+        with:
+            path: otp_docker_base.tar
+            key: ${{ runner.os }}-${{ hashFiles('.github/dockerfiles/Dockerfile.ubuntu-base', '.github/scripts/build-base-image.sh') }}
+      - name: Download otp build
+        uses: actions/download-artifact@v2
+        with:
+          name: otp-ubuntu-20.04
+      - name: Docker login
+        uses: docker/login-action@v1
+        with:
+          registry: docker.pkg.github.com
+          username: ${{ github.repository_owner }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+      - name: Restore docker image
+        run: .github/scripts/restore-otp-image.sh
+      - name: Build Erlang/OTP flavors and types
+        run: |
+            TYPES="opt debug lcnt"
+            FLAVORS="emu jit"
+            for TYPE in ${TYPES}; do
+              for FLAVOR in ${FLAVORS}; do
+                echo "::group::{TYPE=$TYPE FLAVOR=$FLAVOR}"
+                docker run otp "make TYPE=$TYPE FLAVOR=$FLAVOR"
+                echo "::endgroup::"
+              done
+            done
+
   build:
     name: Build Erlang/OTP
     runs-on: ubuntu-latest
-- 
2.35.3

openSUSE Build Service is sponsored by