Skip to content

Commit 941c643

Browse files
committed
ci yum: split v6 and v7 build job
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
1 parent dc40999 commit 941c643

3 files changed

Lines changed: 117 additions & 96 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Reusable Build Deb
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
rake-job:
7+
required: true
8+
type: string
9+
runs-on:
10+
required: true
11+
type: string
12+
next-major:
13+
required: true
14+
type: boolean
15+
cache-group:
16+
required: true
17+
type: string
18+
19+
jobs:
20+
build:
21+
runs-on: ${{ inputs.runs-on }}
22+
steps:
23+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
- name: cache rpm
25+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
26+
id: cache-rpm
27+
with:
28+
path: |
29+
fluent-package/yum/repositories
30+
fluent-release/yum/repositories
31+
fluent-lts-release/yum/repositories
32+
v7-test/fluent-package/yum/repositories
33+
key: ${{ runner.os }}-cache-${{ inputs.rake-job }}-${{ runner.arch }}-${{ inputs.cache-group }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }}
34+
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
35+
with:
36+
ruby-version: '3.4'
37+
- name: Install dependencies
38+
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
39+
run: |
40+
gem install serverspec --no-document
41+
- name: Build rpm with Docker
42+
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
43+
run: |
44+
rake yum:build YUM_TARGETS=${{ inputs.rake-job }}
45+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
46+
if: ${{ ! steps.cache-rpm.outputs.cache-hit && inputs.next-major }}
47+
with:
48+
path: v7-test
49+
- name: Build v7 rpm with Docker
50+
if: ${{ ! steps.cache-rpm.outputs.cache-hit && inputs.next-major }}
51+
run: |
52+
cd v7-test
53+
git config user.email "fluentd@googlegroups.com"
54+
git config user.name "Fluentd developers"
55+
git am fluent-package/bump-version-v7.patch
56+
rake yum:build YUM_TARGETS=${{ inputs.rake-job }}
57+
- name: Upload fluent-package rpm
58+
if: ${{ ! inputs.next-major }}
59+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
60+
with:
61+
name: packages-${{ inputs.rake-job }}
62+
path: fluent-package/yum/repositories
63+
- name: Upload fluent-release rpm
64+
if: ${{ ! inputs.next-major }}
65+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
66+
with:
67+
name: packages-release-${{ inputs.rake-job }}
68+
path: fluent-release/yum/repositories
69+
- name: Upload fluent-lts-release rpm
70+
if: ${{ ! inputs.next-major }}
71+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
72+
with:
73+
name: packages-lts-release-${{ inputs.rake-job }}
74+
path: fluent-lts-release/yum/repositories
75+
- name: Upload v7 fluent-package rpm
76+
if: ${{ inputs.next-major }}
77+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
78+
with:
79+
name: v7-packages-${{ inputs.rake-job }}
80+
path: v7-test/fluent-package/yum/repositories

.github/workflows/yum-arm.yml

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,47 +24,27 @@ jobs:
2424
build:
2525
name: Build
2626
needs: define-matrix
27+
uses: ./.github/workflows/_build_rpm_reusable.yml
2728
strategy:
2829
fail-fast: false
2930
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
30-
runs-on: ubuntu-24.04-arm
31-
steps:
32-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
33-
- name: cache rpm
34-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
35-
id: cache-rpm
36-
with:
37-
path: |
38-
fluent-package/yum/repositories
39-
fluent-release/yum/repositories
40-
fluent-lts-release/yum/repositories
41-
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-aarch64-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }}
42-
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
43-
with:
44-
ruby-version: '3.4'
45-
- name: Install dependencies
46-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
47-
run: |
48-
gem install serverspec --no-document
49-
- name: Build rpm with Docker
50-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
51-
run: |
52-
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}-aarch64
53-
- name: Upload fluent-package rpm
54-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
55-
with:
56-
name: packages-${{ matrix.rake-job }}-aarch64
57-
path: fluent-package/yum/repositories
58-
- name: Upload fluent-release rpm
59-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
60-
with:
61-
name: packages-release-${{ matrix.rake-job }}-aarch64
62-
path: fluent-release/yum/repositories
63-
- name: Upload fluent-lts-release rpm
64-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
65-
with:
66-
name: packages-lts-release-${{ matrix.rake-job }}-aarch64
67-
path: fluent-lts-release/yum/repositories
31+
with:
32+
rake-job: ${{ matrix.rake-job }}-aarch64
33+
runs-on: ubuntu-24.04-arm
34+
next-major: false
35+
cache-group: v6
36+
build-next:
37+
name: Build next major
38+
needs: define-matrix
39+
uses: ./.github/workflows/_build_rpm_reusable.yml
40+
strategy:
41+
fail-fast: false
42+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
43+
with:
44+
rake-job: ${{ matrix.rake-job }}-aarch64
45+
runs-on: ubuntu-24.04-arm
46+
next-major: true
47+
cache-group: v7
6848
check_package_size:
6949
name: Check Package Size
7050
runs-on: ubuntu-24.04-arm

.github/workflows/yum.yml

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,27 @@ jobs:
2727
build:
2828
needs: define-matrix
2929
name: Build
30-
timeout-minutes: 120
30+
uses: ./.github/workflows/_build_rpm_reusable.yml
3131
strategy:
3232
fail-fast: false
3333
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
34-
runs-on: ubuntu-latest
35-
steps:
36-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37-
- name: cache rpm
38-
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
39-
id: cache-rpm
40-
with:
41-
path: |
42-
fluent-package/yum/repositories
43-
fluent-release/yum/repositories
44-
fluent-lts-release/yum/repositories
45-
v7-test/fluent-package/yum/repositories
46-
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in', 'fluent-package/templates/**', 'fluent-package/yum/**/Dockerfile') }}
47-
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
48-
with:
49-
ruby-version: '3.4'
50-
- name: Install dependencies
51-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
52-
run: |
53-
gem install serverspec --no-document
54-
- name: Build rpm with Docker
55-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
56-
run: |
57-
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
58-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
59-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
60-
with:
61-
path: v7-test
62-
- name: Build v7 rpm with Docker
63-
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
64-
run: |
65-
cd v7-test
66-
git config user.email "fluentd@googlegroups.com"
67-
git config user.name "Fluentd developers"
68-
git am fluent-package/bump-version-v7.patch
69-
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
70-
- name: Upload fluent-package rpm
71-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
72-
with:
73-
name: packages-${{ matrix.rake-job }}
74-
path: fluent-package/yum/repositories
75-
- name: Upload fluent-release rpm
76-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
77-
with:
78-
name: packages-release-${{ matrix.rake-job }}
79-
path: fluent-release/yum/repositories
80-
- name: Upload fluent-lts-release rpm
81-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
82-
with:
83-
name: packages-lts-release-${{ matrix.rake-job }}
84-
path: fluent-lts-release/yum/repositories
85-
- name: Upload v7 fluent-package rpm
86-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
87-
with:
88-
name: v7-packages-${{ matrix.rake-job }}
89-
path: v7-test/fluent-package/yum/repositories
34+
with:
35+
rake-job: ${{ matrix.rake-job }}
36+
runs-on: ubuntu-latest
37+
next-major: false
38+
cache-group: v6
39+
build-next:
40+
needs: define-matrix
41+
name: Build next major
42+
uses: ./.github/workflows/_build_rpm_reusable.yml
43+
strategy:
44+
fail-fast: false
45+
matrix: ${{ fromJSON(needs.define-matrix.outputs.matrix) }}
46+
with:
47+
rake-job: ${{ matrix.rake-job }}
48+
runs-on: ubuntu-latest
49+
next-major: true
50+
cache-group: v7
9051
check_package_size:
9152
name: Check Package Size
9253
runs-on: ubuntu-latest
@@ -255,7 +216,7 @@ jobs:
255216

256217
v2test:
257218
name: Test ${{ matrix.label }} ${{ matrix.test }} (CGroup V2)
258-
needs: [define-matrix, check_package_size, installation_test, serverspec_test, binstubs_test]
219+
needs: [define-matrix, check_package_size, installation_test, serverspec_test, binstubs_test, build-next]
259220
runs-on: ubuntu-latest
260221
timeout-minutes: 15
261222
strategy:

0 commit comments

Comments
 (0)