Skip to content

Commit

Permalink
ci: cache package to reduce build time
Browse files Browse the repository at this point in the history
Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Oct 31, 2024
1 parent 4a5caae commit da49954
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ jobs:
sudo apt -V install ruby ruby-bundler ruby-serverspec
sudo gem install bundler:2.2.9 --no-document
sudo gem uninstall fileutils
- name: cache deb
uses: actions/cache@v4
id: cache-deb
with:
path: |
fluent-package/apt/repositories
fluent-apt-source/apt/repositories
fluent-lts-apt-source/apt/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', 'fluent-package/templates/**', 'fluent-package/debian/**', 'fluent-package/apt/**/Dockerfile') }}
- name: Build deb with Docker
if: ${{ ! steps.cache-deb.outputs.cache-hit }}
run: |
rake apt:build APT_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package deb
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ jobs:
with:
ruby-version: 3.1
- uses: actions/checkout@master
- name: cache msi
uses: actions/cache@v4
id: cache-msi
with:
path: fluent-package/msi/repositories
key: ${{ runner.os }}-cache-windows-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '!**/*.ps1') }}
- name: Build
if: ${{ ! steps.cache-msi.outputs.cache-hit }}
run: |
gem install serverspec
gem install bundler:2.2.9 --no-document
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/yum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ jobs:
sudo apt -V install ruby ruby-bundler ruby-serverspec
sudo gem install bundler:2.2.9 --no-document
sudo gem uninstall fileutils
- name: cache rpm
uses: actions/cache@v4
id: cache-rpm
with:
path: fluent-package/yum/repositories
key: ${{ runner.os }}-cache-${{ matrix.rake-job }}-${{ hashFiles('**/config.rb', '**/Rakefile', '**/Gemfile*', '**/*.spec.in') }}
- name: Build rpm with Docker
if: ${{ ! steps.cache-rpm.outputs.cache-hit }}
run: |
rake yum:build YUM_TARGETS=${{ matrix.rake-job }}
- name: Upload fluent-package rpm
Expand Down

0 comments on commit da49954

Please sign in to comment.