Skip to content

Commit

Permalink
try to push built images to dockerhub
Browse files Browse the repository at this point in the history
Signed-off-by: Shi, Crane <crane.shi@emc.com>
  • Loading branch information
CraneShiEMC committed May 13, 2023
1 parent 5ecf0c9 commit d67640e
Showing 1 changed file with 85 additions and 80 deletions.
165 changes: 85 additions & 80 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master ]

env:
REGISTRY: 'ghcr.io/dell/csi-baremetal'
REGISTRY: 'craneshiemc'
go_version: '1.17.7'
golangci_version: '1.44.0'
helm_version: '3.7.1'
Expand Down Expand Up @@ -180,99 +180,104 @@ jobs:

- name: Build docker images
run: |
docker login -u craneshiemc -p 52XiaoKeAi
make images REGISTRY=${{ env.REGISTRY }}
make DRIVE_MANAGER_TYPE=loopbackmgr image-drivemgr REGISTRY=${{ env.REGISTRY }}
make push REGISTRY=${{ env.REGISTRY }}
make DRIVE_MANAGER_TYPE=loopbackmgr push-drivemgr REGISTRY=${{ env.REGISTRY }}
- name: Build Operator docker image
run: |
cd ${{env.CSI_BAREMETAL_OPERATOR_DIR}}
docker login -u craneshiemc -p 52XiaoKeAi
make docker-build REGISTRY=${{ env.REGISTRY }}
make docker-push REGISTRY=${{ env.REGISTRY }}
- name: Kind preparation
run: |
cd ${{env.CSI_BAREMETAL_DIR}}
make kind-build
make kind-create-cluster KIND_CONFIG=${{env.kind_config}} KIND_WAIT=${{env.kind_wait}}
kubectl cluster-info --context kind-kind
kubectl get pods -o wide --all-namespaces
echo "current-context:" $(kubectl config current-context)
echo "environment-kubeconfig:" ${KUBECONFIG}
# - name: Kind preparation
# run: |
# cd ${{env.CSI_BAREMETAL_DIR}}
# make kind-build
# make kind-create-cluster KIND_CONFIG=${{env.kind_config}} KIND_WAIT=${{env.kind_wait}}
# kubectl cluster-info --context kind-kind
# kubectl get pods -o wide --all-namespaces
# echo "current-context:" $(kubectl config current-context)
# echo "environment-kubeconfig:" ${KUBECONFIG}

- name: Sidecars preparing
run: |
make deps-docker-pull
make deps-docker-tag
- name: Retag CSI images and load them to kind
run: |
docker images
make kind-tag-images TAG=$CSI_VERSION REGISTRY=${{ env.REGISTRY }}
make kind-load-images TAG=$CSI_VERSION REGISTRY=${{ env.REGISTRY }}
make kind-tag-operator-image OPERATOR_VERSION=$CSI_OPERATOR_VERSION REGISTRY=${{ env.REGISTRY }}
make kind-load-operator-image OPERATOR_VERSION=$CSI_OPERATOR_VERSION
- name: Make test
continue-on-error: true
id: tests
run: make test-short-ci CSI_VERSION=$CSI_VERSION OPERATOR_VERSION=$CSI_OPERATOR_VERSION CHARTS_DIR=${{env.CSI_BAREMETAL_OPERATOR_DIR}}/charts

- name: Publish Unit Test Results
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/ci')
uses: EnricoMi/publish-unit-test-result-action@v1
with:
check_name: "E2E Test Results"
commit: '${{ steps.sha.outputs.result }}'
files: tests/e2e/reports/report.xml
hide_comments: off
check_run_annotations: all tests
comment_mode: create new

- uses: montudor/action-zip@v1
with:
args: zip -qq -r reports.zip tests/e2e/reports
# - name: Retag CSI images and load them to kind
# run: |
# docker images
# make kind-tag-images TAG=$CSI_VERSION REGISTRY=${{ env.REGISTRY }}
# make kind-load-images TAG=$CSI_VERSION REGISTRY=${{ env.REGISTRY }}
# make kind-tag-operator-image OPERATOR_VERSION=$CSI_OPERATOR_VERSION REGISTRY=${{ env.REGISTRY }}
# make kind-load-operator-image OPERATOR_VERSION=$CSI_OPERATOR_VERSION

- name: Upload report to artifacts
uses: actions/upload-artifact@v2.2.1
with:
name: e2e_artifacts_archive
path: reports.zip
# - name: Make test
# continue-on-error: true
# id: tests
# run: make test-short-ci CSI_VERSION=$CSI_VERSION OPERATOR_VERSION=$CSI_OPERATOR_VERSION CHARTS_DIR=${{env.CSI_BAREMETAL_OPERATOR_DIR}}/charts
#
# - name: Publish Unit Test Results
# if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/ci')
# uses: EnricoMi/publish-unit-test-result-action@v1
# with:
# check_name: "E2E Test Results"
# commit: '${{ steps.sha.outputs.result }}'
# files: tests/e2e/reports/report.xml
# hide_comments: off
# check_run_annotations: all tests
# comment_mode: create new

- name: Upload report to artifacts
uses: actions/upload-artifact@v2.2.1
with:
name: e2e_artifacts_log
path: tests/log.txt
# - uses: montudor/action-zip@v1
# with:
# args: zip -qq -r reports.zip tests/e2e/reports
#
# - name: Upload report to artifacts
# uses: actions/upload-artifact@v2.2.1
# with:
# name: e2e_artifacts_archive
# path: reports.zip
#
# - name: Upload report to artifacts
# uses: actions/upload-artifact@v2.2.1
# with:
# name: e2e_artifacts_log
# path: tests/log.txt
#
# - name: Fail if test fails
# if: steps.tests.outcome != 'success'
# uses: actions/github-script@v3
# with:
# script: |
# core.setFailed('E2E Tests failed!')

- name: Fail if test fails
if: steps.tests.outcome != 'success'
uses: actions/github-script@v3
with:
script: |
core.setFailed('E2E Tests failed!')
result_job:
needs: e2e
runs-on: ubuntu-20.04
steps:
- name: Create answer body
uses: actions/github-script@v5
id: set-answer
env:
TEST_RESULT: ${{ needs.e2e.result }}
with:
result-encoding: string
script: |
const { TEST_RESULT } = process.env
if (`${TEST_RESULT}` === 'failure' ){
return "CI tests failed"
} else if (`${TEST_RESULT}` === 'success'){
return "CI tests passed"
}
return "CI tests canceled"
- name: answer
uses: actions-ecosystem/action-create-comment@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
body: |
@${{ github.actor }}, ${{ steps.set-answer.outputs.result }} Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# result_job:
# needs: e2e
# runs-on: ubuntu-20.04
# steps:
# - name: Create answer body
# uses: actions/github-script@v5
# id: set-answer
# env:
# TEST_RESULT: ${{ needs.e2e.result }}
# with:
# result-encoding: string
# script: |
# const { TEST_RESULT } = process.env
# if (`${TEST_RESULT}` === 'failure' ){
# return "CI tests failed"
# } else if (`${TEST_RESULT}` === 'success'){
# return "CI tests passed"
# }
# return "CI tests canceled"
#
# - name: answer
# uses: actions-ecosystem/action-create-comment@v1
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# body: |
# @${{ github.actor }}, ${{ steps.set-answer.outputs.result }} Run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 comments on commit d67640e

Please sign in to comment.