Skip to content

Commit

Permalink
Use local Shipyard when testing consuming E2E
Browse files Browse the repository at this point in the history
Consuming projects running E2E tests rely on code supplied by Shipyard.
Use the local Shipyard when testing them, to make sure the latest code
is tested, and catch any breakages.

Signed-off-by: Mike Kolesnik <[email protected]>
  • Loading branch information
mkolesnik committed Jan 22, 2023
1 parent 10a2aff commit b1ecc32
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/consuming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,39 @@ jobs:
- project: submariner-operator
k8s_version: '1.24'
steps:
- name: Check out the Shipyard repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c

- name: Build the latest Shipyard image
run: make images

- name: Check out the ${{ matrix.project }} repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
# This is replaced to stable branch by auto release process
ref: devel
repository: submariner-io/${{ matrix.project }}
path: ${{ matrix.project }}

- name: Check out the Shipyard repository
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
with:
path: shipyard

- name: Build the latest Shipyard image
run: make -C shipyard images

- name: Copy Shipyard resources
run: cp -n Dockerfile.* Makefile.dapper .dapper ${{ matrix.project }}/
run: cp -n shipyard/{Dockerfile.*,Makefile.dapper,.dapper} .

- name: Make sure ${{ matrix.project }} is using the built Shipyard image
run: sed -i 's/shipyard-dapper-base:*.*/shipyard-dapper-base:dev/' ${{ matrix.project }}/Dockerfile.dapper
run: sed -i 's/shipyard-dapper-base:*.*/shipyard-dapper-base:dev/' Dockerfile.dapper

- name: Make sure ${{ matrix.project }} is using the Shipyard go module
run: make go-replace REPLACE=github.com/submariner-io/shipyard=./shipyard

- name: Run E2E deployment and tests
uses: ./gh-actions/e2e
uses: ./shipyard/gh-actions/e2e
with:
k8s_version: ${{ matrix.k8s_version }}
using: ${{ matrix.cabledriver }} ${{ matrix.deploytool }}
working-directory: ./${{ matrix.project }}

- name: Post mortem
if: failure()
uses: ./gh-actions/post-mortem
uses: ./shipyard/gh-actions/post-mortem

lint-consuming:
name: Lint
Expand Down
5 changes: 5 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ yamllint:
backport:
$(SCRIPTS_DIR)/backport.sh $(release) $(pr)

# [go-replace] allows anyone to quickly and easily set a Go replace
go-replace:
go mod edit -replace=$(REPLACE)
go mod tidy

# [post-mortem] prints a heap of information, to help in debugging failures on the KIND clusters
post-mortem:
$(SCRIPTS_DIR)/post_mortem.sh
Expand Down
5 changes: 0 additions & 5 deletions gh-actions/e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ inputs:
using:
description: 'Various options to pass via using="..."'
required: false
working-directory:
description: 'Working directory to run in'
required: false
default: '.'
target:
description: 'Target for make'
required: false
Expand Down Expand Up @@ -71,7 +67,6 @@ runs:
- name: Run E2E deployment and tests
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
k8s_version=${{ inputs.k8s_version }} &&
make "${{ inputs.target }}" \
Expand Down

0 comments on commit b1ecc32

Please sign in to comment.