Skip to content

WIP: Wait for workers before starting master #243

WIP: Wait for workers before starting master

WIP: Wait for workers before starting master #243

Workflow file for this run

name: Testing
concurrency:
group: testing-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- created
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Run General Linting
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_GO: false
VALIDATE_JSCPD: false
VALIDATE_GITHUB_ACTIONS: false
VALIDATE_NATURAL_LANGUAGE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test
runs-on: ubuntu-latest
env:
JMETER_VERSION: "5.5"
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
- name: Setup Kube in Docker
uses: engineerd/[email protected]
with:
version: "v0.11.1"
# TODO: revert to the latest release once fixed version is released as it fails in 1.2.0
# - name: Setup latest Kangal release
# run: |
# mkdir kangal && cd kangal
# VERSION=$(curl -fsSL "https://api.github.com/repos/hellofresh/kangal/releases" | jq --raw-output 'map(select(.tag_name|startswith("kangal")|not))[0] | .tag_name')
# KANGAL_SOURCE_URL="https://github.com/hellofresh/kangal/archive/${VERSION}.tar.gz"
# curl -X GET -H "Accept:application/octet-stream" -fsSL "$KANGAL_SOURCE_URL" > "/tmp/kangal-source.tar.gz"
# tar -xzf "/tmp/kangal-source.tar.gz" -C /tmp
# mv "/tmp/kangal-${VERSION}"/* .
# make apply-crd
# sed -i "s/Always/IfNotPresent/" pkg/backends/jmeter/resources.go
# make build
- name: Checkout Kangal code
uses: actions/checkout@v2
with:
repository: hellofresh/kangal
path: kangal
- name: Setup Kangal
run: |
cd kangal
make apply-crd
sed -i "s/Always/IfNotPresent/" pkg/backends/jmeter/resources.go
make build
- name: Build Docker base image
uses: docker/build-push-action@v3
with:
build-args: |
JMETER_VERSION=${{env.JMETER_VERSION}}
tags: hellofresh/kangal-jmeter:${{env.JMETER_VERSION}}
context: docker/jmeter-base
file: docker/jmeter-base/Dockerfile
push: false
- name: Build Docker master image
uses: docker/build-push-action@v3
with:
tags: hellofresh/kangal-jmeter-master:local
context: docker/jmeter-master
file: docker/jmeter-master/Dockerfile
push: false
build-args: |
JMETER_VERSION=${{env.JMETER_VERSION}}
- name: Build Docker worker image
uses: docker/build-push-action@v3
with:
tags: hellofresh/kangal-jmeter-worker:local
context: docker/jmeter-worker
file: docker/jmeter-worker/Dockerfile
push: false
build-args: |
JMETER_VERSION=${{env.JMETER_VERSION}}
- name: Load docker images into kind cluster
run: |
docker images
kind load docker-image hellofresh/kangal-jmeter-master:local
kind load docker-image hellofresh/kangal-jmeter-worker:local
- name: Run Integration Test
env:
AWS_ENDPOINT_URL: "localhost:8081"
AWS_BUCKET_NAME: "kangal-test"
JMETER_WORKER_IMAGE_NAME: "hellofresh/kangal-jmeter-worker"
JMETER_MASTER_IMAGE_NAME: "hellofresh/kangal-jmeter-master"
JMETER_WORKER_IMAGE_TAG: "local"
JMETER_MASTER_IMAGE_TAG: "local"
SKIP_GHZ_INTEGRATION_TEST: "1"
run: |
cd kangal
./ci/integration-tests.sh