Test pull_request_target in target branch. #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Integration Tests" | |
on: | |
pull_request_target: | |
types: | |
- labeled | |
env: | |
A8R_AGENT_REGISTRY: 'localhost:5000' | |
KUBECONFIG: ${{ github.workspace }}/kubeconfig.yaml | |
jobs: | |
build-image: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.label.name == 'ok to test' }} | |
steps: | |
- name: Remove label | |
uses: andymckay/labeler@master | |
with: | |
remove-labels: "ok to test" | |
if: always() | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
- name: Setup kubectl | |
uses: azure/setup-kubectl@v3 | |
id: kubectl | |
- name: Provision Kubeception cluster | |
id: kluster | |
uses: datawire/infra-actions/[email protected] | |
with: | |
distribution: Kubeception | |
version: 1.26 | |
kubeconfig: ${{ env.KUBECONFIG }} | |
kubeceptionToken: ${{ secrets.DEV_AMBASSADOR_AGENT_KUBECEPTION_TOKEN }} | |
gkeCredentials: '{"project_id": "foo"}' | |
- name: Add a private image registry to the cluster | |
run: make private-registry | |
- name: Build image | |
id: build | |
run: | | |
make push-image | |
echo "version=$(cat build-output/version.txt)" >> $GITHUB_OUTPUT | |
- name: Run tests | |
uses: nick-invision/retry@v2 | |
env: | |
A8R_AGENT_VERSION: ${{ steps.build.outputs.version }} | |
AMBASSADOR_AGENT_DOCKER_IMAGE: localhost:5000/ambassador-agent:${{ steps.build.outputs.version }} | |
KAT_SERVER_DOCKER_IMAGE: docker.io/datawiredev/kat-server:3.0.1-0.20220817135951-2cb28ef4f415 | |
with: | |
max_attempts: 3 | |
timeout_minutes: 15 | |
command: | | |
make go-integration-test | |
- name: Mark test as succesfull | |
run: echo "::set-output name=run_result::success" > run_result |