Skip to content

Commit

Permalink
Cache RPM packaging CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 13, 2024
1 parent 29cbbd0 commit 9102b54
Showing 1 changed file with 58 additions and 8 deletions.
66 changes: 58 additions & 8 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,70 @@ jobs:
docker_arch: arm64
runner: passenger-ubuntu-24.04-arm64-4cpu
runs-on: ${{ matrix.arch.runner }}
env:
WORKSPACE: ${{ github.workspace }}
RPM_ARCH: ${{ matrix.arch.rpm_arch }}
DOCKER_ARCH: ${{ matrix.arch.docker_arch }}
CACHE_DIR: ${{ github.workspace }}/cache/rpm-test/${{ matrix.distro }}-${{ matrix.arch.rpm_arch }}
DISTRIBUTION: ${{ matrix.distro }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- run: ./dev/ci/tests/rpm/run
- 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: packaging/rpm/cache
SUDO: true

- 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 }}
working-directory: packaging/rpm

- 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 }}
working-directory: packaging/rpm

- name: Update cache
run: ./dev/ci/update-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: packaging/rpm/cache
SUDO: true
if: always()

- 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 9102b54

Please sign in to comment.