Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 71b725f

Browse files
authored
[rocprofiler-systems] Update containers workflow to not push on PR (ROCm#634)
* Change PUSH_COMMAND logic for debugging * Change to only push on non-PR events * Add separate steps for PR and non-PR events * Update .github/workflows/rocprofiler-systems-containers.yml Co-authored-by: Copilot <[email protected]> * Remove $ {{}} from if condition on steps * add github repository check for workflow
1 parent 40df8b2 commit 71b725f

1 file changed

Lines changed: 34 additions & 8 deletions

File tree

.github/workflows/rocprofiler-systems-containers.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626

2727
jobs:
2828
prepare_matrix_ci:
29+
if: github.repository == 'ROCm/rocm-systems'
2930
runs-on: ubuntu-latest
3031
outputs:
3132
matrix_data: ${{ steps.generate_matrix_ci.outputs.matrix_data }}
@@ -69,7 +70,8 @@ jobs:
6970
username: ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }}
7071
password: ${{ secrets.ROCPROF_SYS_DOCKER_TOKEN }}
7172

72-
- name: Build CI Container
73+
- name: Build CI Container (PR - No Push)
74+
if: github.event_name == 'pull_request'
7375
timeout-minutes: 45
7476
uses: nick-fields/retry@v3
7577
with:
@@ -78,12 +80,24 @@ jobs:
7880
max_attempts: 3
7981
command: |
8082
pushd projects/rocprofiler-systems/docker
81-
PUSH_COMMAND="--push"
82-
if [ ${{ github.event_name == 'pull_request' }} ]; then PUSH_COMMAND=""; fi
83-
./build-docker-ci.sh --distro ${{ matrix.distro }} --versions ${{ matrix.version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }} ${PUSH_COMMAND} --jobs 2 --elfutils-version 0.188 --boost-version 1.79.0
83+
./build-docker-ci.sh --distro ${{ matrix.distro }} --versions ${{ matrix.version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }} --jobs 2 --elfutils-version 0.188 --boost-version 1.79.0
84+
popd
85+
86+
- name: Build CI Container (Push)
87+
if: github.event_name != 'pull_request'
88+
timeout-minutes: 45
89+
uses: nick-fields/retry@v3
90+
with:
91+
retry_wait_seconds: 60
92+
timeout_minutes: 45
93+
max_attempts: 3
94+
command: |
95+
pushd projects/rocprofiler-systems/docker
96+
./build-docker-ci.sh --distro ${{ matrix.distro }} --versions ${{ matrix.version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }} --push --jobs 2 --elfutils-version 0.188 --boost-version 1.79.0
8497
popd
8598
8699
prepare_matrix_release:
100+
if: github.repository == 'ROCm/rocm-systems'
87101
runs-on: ubuntu-latest
88102
outputs:
89103
matrix_data: ${{ steps.generate_matrix_release.outputs.matrix_data }}
@@ -126,7 +140,21 @@ jobs:
126140
username: ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }}
127141
password: ${{ secrets.ROCPROF_SYS_DOCKER_TOKEN }}
128142

129-
- name: Build Base Container
143+
- name: Build Base Container (PR - No Push)
144+
if: github.event_name == 'pull_request'
145+
timeout-minutes: 45
146+
uses: nick-fields/retry@v3
147+
with:
148+
retry_wait_seconds: 60
149+
timeout_minutes: 45
150+
max_attempts: 3
151+
command: |
152+
pushd projects/rocprofiler-systems/docker
153+
./build-docker.sh --distro ${{ matrix.os-distro }} --versions ${{ matrix.os-version }} --rocm-versions ${{ matrix.rocm-version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }}
154+
popd
155+
156+
- name: Build Base Container (Push)
157+
if: github.event_name != 'pull_request'
130158
timeout-minutes: 45
131159
uses: nick-fields/retry@v3
132160
with:
@@ -135,7 +163,5 @@ jobs:
135163
max_attempts: 3
136164
command: |
137165
pushd projects/rocprofiler-systems/docker
138-
PUSH_COMMAND="--push"
139-
if [ ${{ github.event_name == 'pull_request' }} ]; then PUSH_COMMAND=""; fi
140-
./build-docker.sh --distro ${{ matrix.os-distro }} --versions ${{ matrix.os-version }} --rocm-versions ${{ matrix.rocm-version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }} ${PUSH_COMMAND}
166+
./build-docker.sh --distro ${{ matrix.os-distro }} --versions ${{ matrix.os-version }} --rocm-versions ${{ matrix.rocm-version }} --user ${{ secrets.ROCPROF_SYS_DOCKER_LOGIN }} --push
141167
popd

0 commit comments

Comments
 (0)