Skip to content

Commit

Permalink
chore: add dmt lint
Browse files Browse the repository at this point in the history
Signed-off-by: Kirill Kramorov <[email protected]>
  • Loading branch information
Kirill Kramorov committed Dec 17, 2024
1 parent 4796454 commit 4085b53
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflow_templates/build-and-test_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ jobs:
- git_info
- pull_request_info
- build_deckhouse
{!{ tmpl.Exec "tests_before_build_template" (slice $ctx "dmtlint") | strings.Indent 4 }!}
{!{ tmpl.Exec "tests_template" (slice $ctx "dmtlint" "build_deckhouse") | strings.Indent 4 }!}

dhctl_tests:
if: ${{ needs.pull_request_info.outputs.changes_not_markdown == 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflow_templates/build-and-test_pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
needs:
- git_info
- build_deckhouse
{!{ tmpl.Exec "tests_before_build_template" (slice $ctx "dmtlint") | strings.Indent 4 }!}
{!{ tmpl.Exec "tests_template" (slice $ctx "dmtlint" "build_deckhouse") | strings.Indent 4 }!}

dhctl_tests:
name: Dhctl Tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflow_templates/build-and-test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ jobs:
name: DMT Lint
needs:
- git_info
- build_deckhouse
{!{ tmpl.Exec "tests_before_build_template" (slice $ctx "dmtlint") | strings.Indent 4 }!}
- build_fe
{!{ tmpl.Exec "tests_template" (slice $ctx "dmtlint" "build_deckhouse") | strings.Indent 4 }!}
{!{ tmpl.Exec "update_comment_on_finish" (slice "job,one-line" $jobNames.matrix_tests) | strings.Indent 6 }!}

{!{ $jobNames = coll.Merge $jobNames (dict "dhctl_tests" "Dhctl Tests") }!}
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/build-and-test_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ jobs:
- pull_request_info
- build_deckhouse

# <template: tests_before_build_template>
# <template: tests_template>
runs-on: [self-hosted, regular]
steps:

Expand Down Expand Up @@ -1228,15 +1228,23 @@ jobs:
# </template: login_rw_registry_step>
- name: Run tests
env:
TESTS_IMAGE_NAME: "registry.deckhouse.io/base_images/golang:1.23.1-bullseye@sha256:a24507d1a36fce86431198a979435dadb187e8d0ce0b5c181f46d6788d84a40f"
TESTS_IMAGE_NAME: ${{needs.build_deckhouse.outputs.tests_image_name}}
run: |
if [[ -z ${TESTS_IMAGE_NAME} ]] ; then
echo "TESTS_IMAGE_NAME is empty"
exit 1
fi
# Decode image name from gzip+base64.
TESTS_IMAGE_NAME=$(echo ${TESTS_IMAGE_NAME} | base64 -d | gunzip)
# Print image name in uppercase to prevent hiding non-secret registry host stored in secret.
echo "Tests image name: '${TESTS_IMAGE_NAME}'" | tr '[:lower:]' '[:upper:]'
echo "⚓️ 📥 [$(date -u)] Pull 'tests' image..."
docker pull ${TESTS_IMAGE_NAME}
echo "⚓️ 🏎 [$(date -u)] Run tests..."
docker run -w /deckhouse -v ${{github.workspace}}:/deckhouse -e "TERM=xterm-256color" -v ~/go-pkg-cache:/go/pkg ${TESTS_IMAGE_NAME} dmt lint -l INFO /modules
# </template: tests_before_build_template>
# </template: tests_template>

dhctl_tests:
if: ${{ needs.pull_request_info.outputs.changes_not_markdown == 'true' }}
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/build-and-test_pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ jobs:
- git_info
- build_deckhouse

# <template: tests_before_build_template>
# <template: tests_template>
runs-on: [self-hosted, regular]
steps:

Expand Down Expand Up @@ -943,15 +943,23 @@ jobs:
# </template: login_rw_registry_step>
- name: Run tests
env:
TESTS_IMAGE_NAME: "registry.deckhouse.io/base_images/golang:1.23.1-bullseye@sha256:a24507d1a36fce86431198a979435dadb187e8d0ce0b5c181f46d6788d84a40f"
TESTS_IMAGE_NAME: ${{needs.build_deckhouse.outputs.tests_image_name}}
run: |
if [[ -z ${TESTS_IMAGE_NAME} ]] ; then
echo "TESTS_IMAGE_NAME is empty"
exit 1
fi
# Decode image name from gzip+base64.
TESTS_IMAGE_NAME=$(echo ${TESTS_IMAGE_NAME} | base64 -d | gunzip)
# Print image name in uppercase to prevent hiding non-secret registry host stored in secret.
echo "Tests image name: '${TESTS_IMAGE_NAME}'" | tr '[:lower:]' '[:upper:]'
echo "⚓️ 📥 [$(date -u)] Pull 'tests' image..."
docker pull ${TESTS_IMAGE_NAME}
echo "⚓️ 🏎 [$(date -u)] Run tests..."
docker run -w /deckhouse -v ${{github.workspace}}:/deckhouse -e "TERM=xterm-256color" -v ~/go-pkg-cache:/go/pkg ${TESTS_IMAGE_NAME} dmt lint -l INFO /modules
# </template: tests_before_build_template>
# </template: tests_template>

dhctl_tests:
name: Dhctl Tests
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/build-and-test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3109,9 +3109,9 @@ jobs:
name: DMT Lint
needs:
- git_info
- build_deckhouse
- build_fe

# <template: tests_before_build_template>
# <template: tests_template>
runs-on: [self-hosted, regular]
steps:

Expand Down Expand Up @@ -3179,15 +3179,23 @@ jobs:
# </template: login_rw_registry_step>
- name: Run tests
env:
TESTS_IMAGE_NAME: "registry.deckhouse.io/base_images/golang:1.23.1-bullseye@sha256:a24507d1a36fce86431198a979435dadb187e8d0ce0b5c181f46d6788d84a40f"
TESTS_IMAGE_NAME: ${{needs.build_deckhouse.outputs.tests_image_name}}
run: |
if [[ -z ${TESTS_IMAGE_NAME} ]] ; then
echo "TESTS_IMAGE_NAME is empty"
exit 1
fi
# Decode image name from gzip+base64.
TESTS_IMAGE_NAME=$(echo ${TESTS_IMAGE_NAME} | base64 -d | gunzip)
# Print image name in uppercase to prevent hiding non-secret registry host stored in secret.
echo "Tests image name: '${TESTS_IMAGE_NAME}'" | tr '[:lower:]' '[:upper:]'
echo "⚓️ 📥 [$(date -u)] Pull 'tests' image..."
docker pull ${TESTS_IMAGE_NAME}
echo "⚓️ 🏎 [$(date -u)] Run tests..."
docker run -w /deckhouse -v ${{github.workspace}}:/deckhouse -e "TERM=xterm-256color" -v ~/go-pkg-cache:/go/pkg ${TESTS_IMAGE_NAME} dmt lint -l INFO /modules
# </template: tests_before_build_template>
# </template: tests_template>
# <template: update_comment_on_finish>
- name: Update comment on finish
id: update_comment_on_finish
Expand Down

0 comments on commit 4085b53

Please sign in to comment.