@@ -13,15 +13,22 @@ jobs:
1313 name : Prepare E2E configuration and image
1414 runs-on : ubuntu-latest
1515 env :
16- # uncomment the below for local testing
17- # DOCKER_REPO: ${{ env.DOCKER_REGISTRY }}/mongodb-atlas-kubernetes-operator
1816 DOCKER_REPO : mongodb/mongodb-atlas-kubernetes-operator-prerelease
1917 steps :
20- - name : Check out code
18+ - if : ${{ inputs.forked == false }}
19+ name : Check out code
21202221 with :
2322 submodules : true
24- fetch-depth : 0 # required for tags
23+ fetch-depth : 0
24+ - if : ${{ inputs.forked == true }}
25+ name : Check out code
26+ 27+ with :
28+ submodules : true
29+ ref : ${{github.event.pull_request.head.sha}}
30+ repository : ${{github.event.pull_request.head.repo.full_name}}
31+ fetch-depth : 0
2532 - name : Prepare tag
2633 id : prepare
2734 uses : ./.github/actions/set-tag
@@ -34,16 +41,72 @@ jobs:
3441 docker_username : ${{ secrets.DOCKER_USERNAME }}
3542 docker_password : ${{ secrets.DOCKER_PASSWORD }}
3643 push_to_quay : false
44+ forked : ${{ inputs.forked }}
45+ prepare-e2e-bundle :
46+ name : Prepare E2E Bundle configuration and image
47+ runs-on : ubuntu-latest
48+ env :
49+ DOCKER_REGISTRY : docker.io
50+ DOCKER_REPO : mongodb/mongodb-atlas-kubernetes-operator-prerelease
51+ DOCKER_BUNDLES_REPO : mongodbinternal/mongodb-atlas-kubernetes-bundles-prerelease
52+ steps :
53+ - if : ${{ inputs.forked == false }}
54+ name : Check out code
55+ 56+ with :
57+ submodules : true
58+ fetch-depth : 0
59+ - if : ${{ inputs.forked == true }}
60+ name : Check out code
61+ 62+ with :
63+ submodules : true
64+ ref : ${{github.event.pull_request.head.sha}}
65+ repository : ${{github.event.pull_request.head.repo.full_name}}
66+ fetch-depth : 0
67+ - name : Prepare tag
68+ id : prepare
69+ uses : ./.github/actions/set-tag
70+ - name : Generate configuration for the tests
71+ uses : ./.github/actions/gen-install-scripts
72+ with :
73+ IMAGE_URL : ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}
74+ VERSION : ${{ steps.prepare.outputs.tag }}
75+ ENV : dev
76+ - name : Change path for the test
77+ run : |
78+ awk '{gsub(/cloud.mongodb.com/, "cloud-qa.mongodb.com", $0); print}' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml > tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
79+ - name : Cache all files
80+ uses : actions/cache@v3
81+ with :
82+ path : ./*
83+ key : ${{ github.sha }}
84+ - name : Prepare docker tag
85+ id : prepare-docker-bundle-tag
86+ run : |
87+ REPOSITORY=${{ env.DOCKER_BUNDLES_REPO }}
88+ TAG=${{ steps.prepare.outputs.tag }}
89+ TAGS="${REPOSITORY}:${TAG}"
90+ echo "tags=$TAGS" >> $GITHUB_OUTPUT
91+ - name : Build and Push image
92+ uses : ./.github/actions/build-push-image
93+ with :
94+ file : bundle.Dockerfile
95+ repository : ${{ env.DOCKER_BUNDLES_REPO }}
96+ version : ${{ steps.prepare.outputs.tag }}
97+ platforms : linux/amd64
98+ docker_username : ${{ secrets.DOCKER_USERNAME }}
99+ docker_password : ${{ secrets.DOCKER_PASSWORD }}
100+ push_to_quay : false
101+ forked : ${{ inputs.forked }}
37102 e2e :
38103 name : E2E tests
39- needs : prepare-e2e
104+ needs : [ prepare-e2e, prepare-e2e-bundle]
40105 runs-on : ubuntu-latest
41106 env :
42- # uncomment the below for local testing
43- # DOCKER_REPO: ${{ env.DOCKER_REGISTRY }}/mongodb-atlas-kubernetes-operator
44107 DOCKER_REGISTRY : docker.io
45- DOCKER_BUNDLES_REPO : mongodbinternal/mongodb-atlas-kubernetes-bundles-prerelease
46108 DOCKER_REPO : mongodb/mongodb-atlas-kubernetes-operator-prerelease
109+ DOCKER_BUNDLES_REPO : mongodbinternal/mongodb-atlas-kubernetes-bundles-prerelease
47110 strategy :
48111 fail-fast : false
49112 matrix :
@@ -74,42 +137,14 @@ jobs:
74137 " teams" ,
75138 ]
76139 steps :
77- - name : Check out code
78- uses : actions/checkout @v3.1.0
140+ - name : Cache all files
141+ uses : actions/cache @v3
79142 with :
80- submodules : recursive
143+ path : ./*
144+ key : ${{ github.sha }}
81145 - name : Prepare tag
82146 id : prepare
83147 uses : ./.github/actions/set-tag
84- - name : Generate configuration for the tests
85- uses : ./.github/actions/gen-install-scripts
86- with :
87- IMAGE_URL : ${{ env.DOCKER_REPO }}:${{ steps.prepare.outputs.tag }}
88- VERSION : ${{ steps.prepare.outputs.tag }}
89- ENV : dev
90- - name : Change path for the test
91- run : |
92- awk '{gsub(/cloud.mongodb.com/, "cloud-qa.mongodb.com", $0); print}' bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml > tmp && mv tmp bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml
93- - name : Login to docker.io
94- uses : docker/login-action@v2
95- with :
96- username : ${{ secrets.DOCKER_USERNAME }}
97- password : ${{ secrets.DOCKER_PASSWORD }}
98- - name : Prepare docker tag
99- id : prepare-docker-bundle-tag
100- run : |
101- REPOSITORY=${{ env.DOCKER_BUNDLES_REPO }}
102- TAG=${{ steps.prepare.outputs.tag }}
103- TAGS="${REPOSITORY}:${TAG}"
104- echo "tags=$TAGS" >> $GITHUB_OUTPUT
105- - name : Push bundle-image for the test
106- if : ${{ matrix.test == 'openshift' || matrix.test == 'bundle-test' && !env.ACT }}
107- uses : docker/build-push-action@v3
108- with :
109- context : .
110- push : true
111- tags : ${{ steps.prepare-docker-bundle-tag.outputs.tags }}
112- file : bundle.Dockerfile
113148 - name : Set properties
114149 id : properties
115150 run : |
@@ -129,7 +164,7 @@ jobs:
129164 - name : Setup Go
130165 uses : actions/setup-go@v3
131166 with :
132- go-version : " 1.18 "
167+ go-version-file : " ${{ github.workspace }}/go.mod "
133168 - name : Install operator-sdk-v1.22.0
134169 run : |
135170 wget https://github.com/operator-framework/operator-sdk/releases/download/v1.22.0/operator-sdk_linux_amd64 -q
0 commit comments