Skip to content

Commit

Permalink
GHA: Put all the preliminary steps into pre-action for s390x
Browse files Browse the repository at this point in the history
This is to introduce a pre-action to all the workflows for building artifacts.
The action could take care of tasks such as cleaning up files and reinstalling
packages, which prevents a workflow from getting affected by the environment.

This also includes the removal of the step `Adjust a permission for repo`,
because it could be incorporated into the action.

Fixes: #8648

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
  • Loading branch information
BbolroC committed Dec 13, 2023
1 parent ee74fca commit f6bd4a5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/build-kata-static-tarball-s390x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ jobs:
stage:
- ${{ inputs.stage }}
steps:
- name: Adjust a permission for repo
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

- name: Login to Kata Containers quay.io
if: ${{ inputs.push-to-registry == 'yes' }}
Expand Down Expand Up @@ -87,9 +86,9 @@ jobs:
runs-on: s390x
needs: build-asset
steps:
- name: Adjust a permission for repo
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

- uses: actions/checkout@v3

- name: get-artifacts
Expand Down Expand Up @@ -131,9 +130,8 @@ jobs:
runs-on: s390x
needs: [build-asset, build-asset-boot-image-se]
steps:
- name: Adjust a permission for repo
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

- uses: actions/checkout@v4
with:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-nightly-s390x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ jobs:
k8s-cri-containerd-rhel9-e2e-tests:
runs-on: s390x-rhel9
steps:
- name: Delete the existing files
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
sudo rm -rf $GITHUB_WORKSPACE/*
- name: Take a pre-action for self-hosted runner
run: |
${HOME}/script/pre_action.sh rhel9-nightly
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/publish-kata-deploy-payload-s390x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ jobs:
kata-payload:
runs-on: s390x
steps:
- name: Adjust a permission for repo
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

- uses: actions/checkout@v4
with:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/run-cri-containerd-tests-s390x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
GOPATH: ${{ github.workspace }}
KATA_HYPERVISOR: ${{ matrix.vmm }}
steps:
- name: Adjust a permission for repo
run: sudo chown -R $USER:$USER $GITHUB_WORKSPACE

- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/run-k8s-tests-on-zvsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ jobs:
USING_NFD: "true"
TARGET_ARCH: "s390x"
steps:
- name: Adjust a permission for repo
run: sudo chown -R $USER:$USER $GITHUB_WORKSPACE

- name: Take a pre-action for self-hosted runner
run: ${HOME}/script/pre_action.sh ubuntu-2204

Expand Down

0 comments on commit f6bd4a5

Please sign in to comment.