Skip to content

Commit

Permalink
installer-pr workflow: diff packages inside a container
Browse files Browse the repository at this point in the history
container-diff doesn't work nicely with GitHub Ubuntu runners.
Use a BCI image to run a container and run the diff inside the container.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
  • Loading branch information
bk201 authored and guangbochen committed May 4, 2023
1 parent 67574e4 commit e69adf1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/installer-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ env:
jobs:
generate-image-diff:
runs-on: ubuntu-latest
container:
image: registry.suse.com/bci/bci-base:15.4
steps:
- name: Pull new image
uses: nick-fields/retry@v2
Expand All @@ -19,8 +21,8 @@ jobs:
command: 'docker pull ${{ env.IMAGE_NAME }}'
- name: Install container-diff
run: |
sudo curl -sfL https://github.com/GoogleContainerTools/container-diff/releases/download/v0.17.0/container-diff-linux-amd64 -o /usr/bin/container-diff
sudo chmod +x /usr/bin/container-diff
curl -sfL https://github.com/GoogleContainerTools/container-diff/releases/download/v0.17.0/container-diff-linux-amd64 -o /usr/bin/container-diff
chmod +x /usr/bin/container-diff
- name: Get current OS image from installer
run: |
curl -sfL https://raw.githubusercontent.com/harvester/harvester-installer/master/scripts/package-harvester-os -o /tmp/package-harvester-os
Expand All @@ -30,7 +32,7 @@ jobs:
source /tmp/tmp-env
docker pull $BASE_OS_IMAGE
echo "Diff $BASE_OS_IMAGE with ${{ env.IMAGE_NAME }}..."
sudo container-diff diff daemon://docker.io/$BASE_OS_IMAGE daemon://docker.io/${{ env.IMAGE_NAME }} --type=rpm --output=diff-result.txt
container-diff diff daemon://docker.io/$BASE_OS_IMAGE daemon://docker.io/${{ env.IMAGE_NAME }} --type=rpm --output=diff-result.txt
cat diff-result.txt
- name: Upload container-diff result
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit e69adf1

Please sign in to comment.