Skip to content

Commit

Permalink
ci(scorecard): install podman after check
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed Aug 24, 2023
1 parent dfc06aa commit e8eca86
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ env:
CI_PLATFORMS: linux/amd64,linux/arm64
REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
REF: ${{ github.event.pull_request.head.ref }}
RUNNER_VERSION: "22.04"

jobs:
controller-test:
Expand Down Expand Up @@ -61,7 +62,7 @@ jobs:
- name: Run controller tests
run: make test-envtest
scorecard-test:
runs-on: ubuntu-latest # 22.04
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'cryostatio' }}
steps:
- name: Fail if safe-to-test label NOT applied
Expand All @@ -76,12 +77,11 @@ jobs:
operator-sdk-version: v1.28.0
- name: Install podman v4
run: |
ubuntu_version='22.04'
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}"
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}"
sudo echo "deb $sources_url/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
sudo curl -fsSL $key_url | gpg --dearmor | tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb $sources_url/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
curl -fsSL $key_url | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
sudo apt update
sudo apt install podman
- name: Build scorecard image for test
Expand Down Expand Up @@ -166,12 +166,11 @@ jobs:
- uses: actions/checkout@v2
- name: Install podman v4
run: |
ubuntu_version='22.04'
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}"
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}"
sudo echo "deb $sources_url/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
sudo curl -fsSL $key_url | gpg --dearmor | tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo "deb $sources_url/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
curl -fsSL $key_url | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
sudo apt update
sudo apt install podman
- name: Build operator image
Expand Down Expand Up @@ -235,16 +234,6 @@ jobs:
if: ${{ github.event_name == 'push' && github.repository_owner == 'cryostatio' }}
steps:
- uses: actions/checkout@v2
- name: Install podman v4
run: |
ubuntu_version='22.04'
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}"
sudo echo "deb $sources_url/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
sudo curl -fsSL $key_url | gpg --dearmor | tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
sudo apt update
sudo apt install podman
- name: Get scorecard image tag
id: get-image-tag
run: |
Expand All @@ -258,7 +247,15 @@ jobs:
EXIST=true
fi
echo "exist=$EXIST" >> $GITHUB_OUTPUT
if: ${{ steps.check-tag-exists.outputs.exist == 'false' }}
- name: Install podman v4
run: |
key_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}/Release.key"
sources_url="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${RUNNER_VERSION}"
echo "deb $sources_url/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list
curl -fsSL $key_url | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_kubic_libcontainers_unstable.gpg > /dev/null
sudo apt update
sudo apt install podman
- name: Build scorecard image
run: |
CUSTOM_SCORECARD_IMG=${CI_SCORECARD_IMG}:${{ steps.get-image-tag.outputs.tag }} \
Expand Down

0 comments on commit e8eca86

Please sign in to comment.