From 0d6a191891006da1705c1c7a071d38368e1c2478 Mon Sep 17 00:00:00 2001 From: nshankar13 Date: Fri, 13 Aug 2021 13:45:22 -0400 Subject: [PATCH] test(pipeline): Push latest-main images nightly Signed-off-by: nshankar13 --- .github/workflows/nightly-images.yml | 37 +++++++++++++++++++++++++ .github/workflows/nightly-noinstall.yml | 16 +++++------ .github/workflows/openshift-nightly.yml | 8 ++++-- 3 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/nightly-images.yml diff --git a/.github/workflows/nightly-images.yml b/.github/workflows/nightly-images.yml new file mode 100644 index 0000000000..30796a2c50 --- /dev/null +++ b/.github/workflows/nightly-images.yml @@ -0,0 +1,37 @@ +name: Nightly Images +on: + schedule: + - cron: "0 0 * * *" + +jobs: + images: + name: Docker Images + runs-on: ubuntu-latest + env: + DOCKER_USER: ${{ secrets.RELEASE_DOCKER_USER }} + DOCKER_PASS: ${{ secrets.RELEASE_DOCKER_PASS }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Restore Module Cache + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-gomod2-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-gomod2- + - name: Restore Build Cache + uses: actions/cache@v2 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-gobuild-${{ hashFiles('**/*.go') }} + - name: Setup Go 1.16 + uses: actions/setup-go@v1 + with: + go-version: 1.16 + - name: Docker Login + run: docker login --username "$DOCKER_USER" --password-stdin <<< "$DOCKER_PASS" + - name: Push images with git sha tag + env: + CTR_TAG: latest-main + run: make docker-push diff --git a/.github/workflows/nightly-noinstall.yml b/.github/workflows/nightly-noinstall.yml index 0f4543df56..943609f900 100644 --- a/.github/workflows/nightly-noinstall.yml +++ b/.github/workflows/nightly-noinstall.yml @@ -1,12 +1,18 @@ name: OSM NoInstall Nightly Job on: - schedule: - - cron: "0 0 * * *" + workflow_run: + workflows: ["Nightly Images"] + types: [completed] + +env: + CTR_REGISTRY: openservicemesh + CTR_TAG: latest-main jobs: test: name: NoInstall Nightly Job runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} env: KUBECONFIG: ${{ github.workspace }}/kind-kubeconfig steps: @@ -54,13 +60,7 @@ jobs: ./bin/osm install \ --set=OpenServiceMesh.image.registry="$CTR_REGISTRY" \ --set=OpenServiceMesh.image.tag="$CTR_TAG" - env: - CTR_REGISTRY: openservicemesh - CTR_TAG: ${{ github.sha }} - name: Run e2es run: go test ./tests/e2e -test.v -ginkgo.v -ginkgo.progress -test.timeout 60m -installType=NoInstall - env: - CTR_REGISTRY: openservicemesh - CTR_TAG: ${{ github.sha }} - name: Kind cleanup run: kind delete cluster --name $KIND_CLUSTER_NAME diff --git a/.github/workflows/openshift-nightly.yml b/.github/workflows/openshift-nightly.yml index a8ae87b639..c53d64e16c 100644 --- a/.github/workflows/openshift-nightly.yml +++ b/.github/workflows/openshift-nightly.yml @@ -1,16 +1,18 @@ name: OpenShift Nightly Job on: - schedule: - - cron: "0 0 * * *" + workflow_run: + workflows: ["Nightly Images"] + types: [completed] env: CTR_REGISTRY: openservicemesh - CTR_TAG: ${{ github.sha }} + CTR_TAG: latest-main jobs: test: name: OpenShift Nightly Job runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: Checkout v2 uses: actions/checkout@v2