From bfc22c98e13e6d6e2c94464cff8ae77c93507735 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Sun, 13 Oct 2024 09:09:15 +0000 Subject: [PATCH] cache RPM CI --- .github/workflows/rpm.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rpm.yml b/.github/workflows/rpm.yml index de7fa2369b..95043f6527 100644 --- a/.github/workflows/rpm.yml +++ b/.github/workflows/rpm.yml @@ -40,6 +40,18 @@ 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: @@ -47,14 +59,24 @@ jobs: 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 @@ -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 }}/*'