From abfb89069019ee83469210ffb4d927302f528809 Mon Sep 17 00:00:00 2001
From: Yaroslav Lobankov <y.lobankov@tarantool.org>
Date: Thu, 19 May 2022 22:17:35 +0400
Subject: [PATCH] ci: add Fedora 36 workflow

Add the fedora_36.yml and fedora_36_aarch64.yml workflow files to build
Tarantool packages for x86_64 and aarch64 systems.

Closes tarantool/tarantool-qa#239

NO_DOC=ci
NO_TEST=ci

(cherry picked from commit fccb6bc0870451152937ddf535a953877fe1fe68)
---
 .github/workflows/fedora_36.yml              | 74 ++++++++++++++++++++
 .github/workflows/fedora_36_aarch64.yml      | 68 ++++++++++++++++++
 changelogs/unreleased/add-fedora-36-ci-cd.md |  3 +
 3 files changed, 145 insertions(+)
 create mode 100644 .github/workflows/fedora_36.yml
 create mode 100644 .github/workflows/fedora_36_aarch64.yml
 create mode 100644 changelogs/unreleased/add-fedora-36-ci-cd.md

diff --git a/.github/workflows/fedora_36.yml b/.github/workflows/fedora_36.yml
new file mode 100644
index 0000000000..19901853fa
--- /dev/null
+++ b/.github/workflows/fedora_36.yml
@@ -0,0 +1,74 @@
+name: fedora_36
+
+on:
+  push:
+    branches:
+      - 'master'
+      - '[0-9].[0-9]+'
+    tags:
+      - '**'
+  pull_request:
+    types: [opened, reopened, synchronize, labeled]
+  workflow_dispatch:
+
+concurrency:
+  # Update of a developer branch cancels the previously scheduled workflow
+  # run for this branch. However, the 'master' branch, release branch (1.10,
+  # 2.8, etc.), and tag workflow runs are never canceled.
+  #
+  # We use a trick here: define the concurrency group as 'workflow run ID' +
+  # 'workflow run attempt' because it is a unique combination for any run.
+  # So it effectively discards grouping.
+  #
+  # Important: we cannot use `github.sha` as a unique identifier because
+  # pushing a tag may cancel a run that works on a branch push event.
+  group: ${{ (
+    github.ref == 'refs/heads/master' ||
+    github.ref == 'refs/heads/1.10' ||
+    startsWith(github.ref, 'refs/heads/2.') ||
+    startsWith(github.ref, 'refs/tags/')) &&
+    format('{0}-{1}', github.run_id, github.run_attempt) ||
+    format('{0}-{1}', github.workflow, github.ref) }}
+  cancel-in-progress: true
+
+jobs:
+  fedora_36:
+    # Run on push to the 'master' and release branches of tarantool/tarantool
+    # or on pull request if the 'full-ci' label is set.
+    if: github.repository == 'tarantool/tarantool' &&
+        ( github.event_name != 'pull_request' ||
+          contains(github.event.pull_request.labels.*.name, 'full-ci') )
+
+    runs-on: ubuntu-20.04-self-hosted
+
+    strategy:
+      fail-fast: false
+      matrix:
+        build-type: [ '', 'gc64' ]
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - uses: ./.github/actions/environment
+      - name: packaging
+        env:
+          RWS_AUTH: ${{ secrets.RWS_AUTH }}
+          OS: 'fedora'
+          DIST: '36'
+          GC64: ${{ matrix.build-type == 'gc64' }}
+        uses: ./.github/actions/pack_and_deploy
+      - name: call action to send Telegram message on failure
+        env:
+          TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_CORE_TOKEN }}
+          TELEGRAM_TO: ${{ secrets.TELEGRAM_CORE_TO }}
+        uses: ./.github/actions/send-telegram-notify
+        if: failure()
+      - name: artifacts
+        uses: actions/upload-artifact@v2
+        if: failure()
+        with:
+          name: fedora-36
+          retention-days: 21
+          path: ${{ env.VARDIR }}/artifacts
diff --git a/.github/workflows/fedora_36_aarch64.yml b/.github/workflows/fedora_36_aarch64.yml
new file mode 100644
index 0000000000..92364c367a
--- /dev/null
+++ b/.github/workflows/fedora_36_aarch64.yml
@@ -0,0 +1,68 @@
+name: fedora_36_aarch64
+
+on:
+  push:
+    branches:
+      - 'master'
+      - '[0-9].[0-9]+'
+    tags:
+      - '**'
+  pull_request:
+    types: [opened, reopened, synchronize, labeled]
+  workflow_dispatch:
+
+concurrency:
+  # Update of a developer branch cancels the previously scheduled workflow
+  # run for this branch. However, the 'master' branch, release branch (1.10,
+  # 2.8, etc.), and tag workflow runs are never canceled.
+  #
+  # We use a trick here: define the concurrency group as 'workflow run ID' +
+  # 'workflow run attempt' because it is a unique combination for any run.
+  # So it effectively discards grouping.
+  #
+  # Important: we cannot use `github.sha` as a unique identifier because
+  # pushing a tag may cancel a run that works on a branch push event.
+  group: ${{ (
+    github.ref == 'refs/heads/master' ||
+    github.ref == 'refs/heads/1.10' ||
+    startsWith(github.ref, 'refs/heads/2.') ||
+    startsWith(github.ref, 'refs/tags/')) &&
+    format('{0}-{1}', github.run_id, github.run_attempt) ||
+    format('{0}-{1}', github.workflow, github.ref) }}
+  cancel-in-progress: true
+
+jobs:
+  fedora_36_aarch64:
+    # Run on push to the 'master' and release branches of tarantool/tarantool
+    # or on pull request if the 'full-ci' label is set.
+    if: github.repository == 'tarantool/tarantool' &&
+        ( github.event_name != 'pull_request' ||
+          contains(github.event.pull_request.labels.*.name, 'full-ci') )
+
+    runs-on: graviton
+
+    steps:
+      - uses: actions/checkout@v2.3.4
+        with:
+          fetch-depth: 0
+          submodules: recursive
+      - uses: ./.github/actions/environment
+      - name: packaging
+        env:
+          RWS_AUTH: ${{ secrets.RWS_AUTH }}
+          OS: 'fedora'
+          DIST: '36'
+        uses: ./.github/actions/pack_and_deploy
+      - name: call action to send Telegram message on failure
+        env:
+          TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_CORE_TOKEN }}
+          TELEGRAM_TO: ${{ secrets.TELEGRAM_CORE_TO }}
+        uses: ./.github/actions/send-telegram-notify
+        if: failure()
+      - name: artifacts
+        uses: actions/upload-artifact@v2
+        if: failure()
+        with:
+          name: fedora-36
+          retention-days: 21
+          path: ${{ env.VARDIR }}/artifacts
diff --git a/changelogs/unreleased/add-fedora-36-ci-cd.md b/changelogs/unreleased/add-fedora-36-ci-cd.md
new file mode 100644
index 0000000000..565e0ddda6
--- /dev/null
+++ b/changelogs/unreleased/add-fedora-36-ci-cd.md
@@ -0,0 +1,3 @@
+## feature/build
+
+* Support Fedora-36 build.
-- 
GitLab