Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
800d19c0
Unverified
Commit
800d19c0
authored
Sep 23, 2023
by
Chris Austen
Committed by
GitHub
Sep 23, 2023
Browse files
Improvements to GH Actions in our CI (#2218)
parent
8c05642e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
37 deletions
+45
-37
.github/workflows/ci.yaml
.github/workflows/ci.yaml
+45
-37
No files found.
.github/workflows/ci.yaml
View file @
800d19c0
...
@@ -11,6 +11,9 @@ on:
...
@@ -11,6 +11,9 @@ on:
env
:
env
:
DOCKER_USER
:
${{secrets.DOCKERHUB_USERID}}
DOCKER_USER
:
${{secrets.DOCKERHUB_USERID}}
DOCKER_TOKEN
:
${{secrets.DOCKERHUB_TOKEN}}
DOCKER_TOKEN
:
${{secrets.DOCKERHUB_TOKEN}}
DOCKER_IMAGE_UBUNTU
:
"
rocm/migraphx-ci-ubuntu"
DOCKER_IMAGE_SLES
:
"
rocm/migraphx-ci-sles"
jobs
:
jobs
:
cancel
:
cancel
:
...
@@ -37,18 +40,16 @@ jobs:
...
@@ -37,18 +40,16 @@ jobs:
-
name
:
Create Image Tag
-
name
:
Create Image Tag
id
:
image_hash
id
:
image_hash
run
:
|
run
:
|
echo "imagetag=
rocm/migraphx-private:
hip-clang-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
echo "imagetag=hip-clang-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
echo "imagetag_sles=
rocm/migraphx-sles-private:
hip-clang-${{hashFiles('**/tools/docker/sles.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
echo "imagetag_sles=hip-clang-${{hashFiles('**/tools/docker/sles.docker', '**/*requirements.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
-
name
:
Check if image is built already
-
name
:
Check if image is built already
id
:
check_image
id
:
check_image
env
:
env
:
DOCKER
IMAGE
:
${{ steps.image_hash.outputs.imagetag }}
DOCKER
_TAG_UBUNTU
:
${{ steps.image_hash.outputs.imagetag }}
DOCKER
IM
AG
E
_SLES
:
${{ steps.image_hash.outputs.imagetag_sles }}
DOCKER
_T
AG_SLES
:
${{ steps.image_hash.outputs.imagetag_sles }}
run
:
|
run
:
|
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
if [[ "$(docker manifest inspect $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU 2> /dev/null)" != "" ]]; then
if [[ "$(docker manifest inspect $DOCKERIMAGE 2> /dev/null)" != "" ]]; then
echo "imageexists=true" >> $GITHUB_OUTPUT
echo "imageexists=true" >> $GITHUB_OUTPUT
echo "Image already exists, skip building available"
echo "Image already exists, skip building available"
else
else
...
@@ -56,7 +57,7 @@ jobs:
...
@@ -56,7 +57,7 @@ jobs:
echo "Tag does not exist, build and publishing required"
echo "Tag does not exist, build and publishing required"
fi
fi
if [[ "$(docker manifest inspect $DOCKERIMAGE_SLES 2> /dev/null)" != "" ]]; then
if [[ "$(docker manifest inspect $DOCKER
_
IMAGE_SLES
:$DOCKER_TAG_SLES
2> /dev/null)" != "" ]]; then
echo "imageexists_sles=true" >> $GITHUB_OUTPUT
echo "imageexists_sles=true" >> $GITHUB_OUTPUT
echo "SLES Image already exists, skip building available"
echo "SLES Image already exists, skip building available"
else
else
...
@@ -75,11 +76,17 @@ jobs:
...
@@ -75,11 +76,17 @@ jobs:
-
name
:
Build and publish
-
name
:
Build and publish
env
:
env
:
DOCKER
IMAGE
:
${{ needs.check_image.outputs.imagetag }}
DOCKER
_TAG_UBUNTU
:
${{ needs.check_image.outputs.imagetag }}
run
:
|
run
:
|
# The TOKEN and USERID are github secrets, Action failures at this step
# can come from a PR from a fork changing a file which forces a rebuild
# Resolve by making an internal PR of the Forked PR
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
docker build . --file hip-clang.docker --tag $DOCKERIMAGE;
docker push $DOCKERIMAGE;
docker pull $DOCKER_IMAGE_UBUNTU:latest || true
docker build . --file hip-clang.docker --cache-from $DOCKER_IMAGE_UBUNTU:latest --tag $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU --tag $DOCKER_IMAGE_UBUNTU:latest;
docker push $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU;
docker push $DOCKER_IMAGE_UBUNTU:latest;
build_SLES_image
:
build_SLES_image
:
name
:
Build SLES image
name
:
Build SLES image
...
@@ -90,18 +97,24 @@ jobs:
...
@@ -90,18 +97,24 @@ jobs:
-
uses
:
actions/checkout@v3
-
uses
:
actions/checkout@v3
-
name
:
Build and publish SLES
-
name
:
Build and publish SLES
env
:
env
:
DOCKER
IM
AG
E
_SLES
:
${{ needs.check_image.outputs.imagetag_sles }}
DOCKER
_T
AG_SLES
:
${{ needs.check_image.outputs.imagetag_sles }}
run
:
|
run
:
|
# The TOKEN and USERID are github secrets, Action failures at this step
# can come from a PR from a fork changing a file wichi forces a rebuild
# Resolve by making an internal PR of the Forked PR
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
docker build . --file tools/docker/sles.docker --tag $DOCKERIMAGE_SLES;
docker push $DOCKERIMAGE_SLES;
docker pull $DOCKER_IMAGE_SLES:latest || true
docker build . --file ./tools/docker/sles.docker --cache-from $DOCKER_IMAGE_SLES:latest --tag $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES --tag $DOCKER_IMAGE_SLES:latest;
docker push $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES;
docker push $DOCKER_IMAGE_SLES:latest;
tidy
:
tidy
:
runs-on
:
ROCM-Ubuntu
runs-on
:
ROCM-Ubuntu
needs
:
[
build_image
,
check_image
]
needs
:
[
build_image
,
check_image
]
env
:
env
:
DOCKER
IMAGE
:
${{ needs.check_image.outputs.imagetag }}
DOCKER
_TAG_UBUNTU
:
${{ needs.check_image.outputs.imagetag }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps
:
steps
:
...
@@ -115,12 +128,8 @@ jobs:
...
@@ -115,12 +128,8 @@ jobs:
key
:
tidy-cache-${{ github.ref }}
key
:
tidy-cache-${{ github.ref }}
restore-keys
:
tidy-cache-
restore-keys
:
tidy-cache-
-
name
:
Docker Login
run
:
|
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
-
name
:
Clang Tidy
-
name
:
Clang Tidy
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}"
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER
_
IMAGE
_UBUNTU:$DOCKER_TAG_UBUNTU
bash < {0}"
run
:
|
run
:
|
mkdir build
mkdir build
cd build
cd build
...
@@ -159,7 +168,7 @@ jobs:
...
@@ -159,7 +168,7 @@ jobs:
runs-on
:
ROCM-Ubuntu
runs-on
:
ROCM-Ubuntu
needs
:
[
build_image
,
check_image
]
needs
:
[
build_image
,
check_image
]
env
:
env
:
DOCKER
IMAGE
:
${{ needs.check_image.outputs.imagetag }}
DOCKER
_TAG_UBUNTU
:
${{ needs.check_image.outputs.imagetag }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps
:
steps
:
...
@@ -173,12 +182,8 @@ jobs:
...
@@ -173,12 +182,8 @@ jobs:
key
:
cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }}
key
:
cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }}
restore-keys
:
cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-
restore-keys
:
cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-
-
name
:
Docker Login
run
:
|
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
-
name
:
Cppcheck
-
name
:
Cppcheck
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}"
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER
_
IMAGE
_UBUNTU:$DOCKER_TAG_UBUNTU
bash < {0}"
run
:
|
run
:
|
mkdir build
mkdir build
cd build
cd build
...
@@ -212,7 +217,7 @@ jobs:
...
@@ -212,7 +217,7 @@ jobs:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
needs
:
[
build_image
,
check_image
]
needs
:
[
build_image
,
check_image
]
env
:
env
:
DOCKER
IMAGE
:
${{ needs.check_image.outputs.imagetag }}
DOCKER
_TAG_UBUNTU
:
${{ needs.check_image.outputs.imagetag }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
if
:
${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps
:
steps
:
...
@@ -220,12 +225,19 @@ jobs:
...
@@ -220,12 +225,19 @@ jobs:
with
:
with
:
fetch-depth
:
0
fetch-depth
:
0
-
name
:
Docker Login
-
name
:
Free space
run
:
|
uses
:
jlumbroso/free-disk-space@main
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
with
:
tool-cache
:
true
android
:
true
dotnet
:
true
haskell
:
true
large-packages
:
true
swap-storage
:
true
docker-images
:
true
-
name
:
Check formatting
-
name
:
Check formatting
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE bash < {0}"
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER
_
IMAGE
_UBUNTU:$DOCKER_TAG_UBUNTU
bash < {0}"
run
:
|
run
:
|
set -e
set -e
git config --global --add safe.directory /data
git config --global --add safe.directory /data
...
@@ -235,7 +247,7 @@ jobs:
...
@@ -235,7 +247,7 @@ jobs:
runs-on
:
ROCM-Ubuntu
runs-on
:
ROCM-Ubuntu
needs
:
[
build_SLES_image
,
check_image
]
needs
:
[
build_SLES_image
,
check_image
]
env
:
env
:
DOCKER
IM
AG
E
_SLES
:
${{ needs.check_image.outputs.imagetag_sles }}
DOCKER
_T
AG_SLES
:
${{ needs.check_image.outputs.imagetag_sles }}
if
:
${{ !cancelled() && (needs.build_SLES_image.result == 'success' || needs.build_SLES_image.result == 'skipped') }}
if
:
${{ !cancelled() && (needs.build_SLES_image.result == 'success' || needs.build_SLES_image.result == 'skipped') }}
steps
:
steps
:
...
@@ -251,12 +263,8 @@ jobs:
...
@@ -251,12 +263,8 @@ jobs:
key
:
ccache-sles-${{ github.ref }}
key
:
ccache-sles-${{ github.ref }}
restore-keys
:
ccache-sles-
restore-keys
:
ccache-sles-
-
name
:
Docker Login
run
:
|
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
-
name
:
Build migraphx
-
name
:
Build migraphx
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKERIMAGE_SLES bash < {0}"
shell
:
bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER
_
IMAGE_SLES
:$DOCKER_TAG_SLES
bash < {0}"
run
:
|
run
:
|
set -e
set -e
export CCACHE_COMPRESSLEVEL=10
export CCACHE_COMPRESSLEVEL=10
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment