Skip to content

Commit

Permalink
cache RPM CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 13, 2024
1 parent c63f59b commit bfc22c9
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,43 @@ jobs:
with:
submodules: true

- run: mkdir work cache output
working-directory: packaging/rpm

- name: Determine test distribution name
id: determine_test_distro
run: |
source packaging/rpm/internal/lib/distro_info.sh
TEST_DISTRO_NAME=$(el_name_to_distro_name "$DISTRIBUTION")
echo "name=$TEST_DISTRO_NAME" >> "$GITHUB_OUTPUT"
env:
DISTRIBUTION: ${{ matrix.distro }}

- name: Fetch cache
run: ./dev/ci/fetch-cache-az-blob-storage
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
BLOB_NAME: "binaries/rpm-cache-${{ matrix.distro }}-${{ matrix.arch.rpm_arch }}.tar.zstd"
CACHE_PATH: cache
working-directory: packaging/rpm

- run: ./dev/ci/tests/rpm/run
- name: Build
run: ./build -w work -c cache -o output -p "$WORKSPACE" -d "$DISTRIBUTION" -a "$RPM_ARCH" -A "$DOCKER_ARCH" -R rpm:all
env:
WORKSPACE: ${{ github.workspace }}
DISTRIBUTION: ${{ matrix.distro }}
RPM_ARCH: ${{ matrix.arch.rpm_arch }}
DOCKER_ARCH: ${{ matrix.arch.docker_arch }}
CACHE_DIR: cache

- name: Test
run: ./test -p "$WORKSPACE" -d "output/$DISTRIBUTION" -c cache -x "$TEST_DISTRO_NAME" -a "$RPM_ARCH" -A "$DOCKER_ARCH" -j
env:
WORKSPACE: ${{ github.workspace }}
DISTRIBUTION: ${{ matrix.distro }}
TEST_DISTRO_NAME: ${{ steps.determine_test_distro.outputs.name }}
RPM_ARCH: ${{ matrix.arch.rpm_arch }}
DOCKER_ARCH: ${{ matrix.arch.docker_arch }}

- name: Update cache
run: ./dev/ci/update-cache-az-blob-storage
Expand All @@ -64,8 +86,9 @@ jobs:
BLOB_NAME: "binaries/rpm-cache-${{ matrix.distro }}-${{ matrix.arch.rpm_arch }}.tar.zstd"
CACHE_PATH: cache
if: always()
working-directory: packaging/rpm

- uses: actions/upload-artifact@v4
with:
name: rpm-${{ matrix.distro }}-${{ matrix.arch.rpm_arch }}
path: 'output/${{ matrix.distro }}/*'
path: 'packaging/rpm/output/${{ matrix.distro }}/*'

0 comments on commit bfc22c9

Please sign in to comment.