-
Notifications
You must be signed in to change notification settings - Fork 0
154 lines (150 loc) · 6.43 KB
/
k8s-e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: (k8s package) E2E tests
on:
pull_request:
concurrency:
group: e2e-tests-k8s-${{ github.ref }}
cancel-in-progress: true
env:
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin-testing-framework-tests:ci.${{ github.sha }}
BASE_IMAGE_NAME: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image:ci.${{ github.sha }}
PLUGIN_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/plugin
PLUGIN_VERSION: develop
SELECTED_NETWORKS: SIMULATED
PLUGIN_COMMIT_SHA: ${{ github.sha }}
PLUGIN_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
jobs:
build_tests:
runs-on: ubuntu-latest
environment: integration
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Build Base Image
uses: goplugin/plugin-github-actions/docker/build-push@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
tags: ${{ env.BASE_IMAGE_NAME }}
file: lib/k8s/Dockerfile.base
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Base Image Built
run: |
# shellcheck disable=SC2086
cat <<EOT >>$GITHUB_STEP_SUMMARY
### plugin image tag used for this test run :link: => \`${{ env.PLUGIN_VERSION }}\`
### test-base-image image tag for this test run :ship: => \`ci.${{ github.sha }}\`
EOT
- name: Build Test Runner
uses: goplugin/plugin-github-actions/docker/build-push@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
tags: ${{ env.ENV_JOB_IMAGE }}
file: lib/k8s/Dockerfile
build-args: |
BASE_IMAGE=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image
IMAGE_VERSION=ci.${{ github.sha }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Test Image Built
run: |
# shellcheck disable=SC2086
cat <<EOT >>$GITHUB_STEP_SUMMARY
### plugin-testing-framework-tests image tag for this test run :ship: -> \`ci.${{ github.sha }}\`
EOT
e2e_tests:
runs-on: ubuntu-latest
environment: integration
permissions:
id-token: write
contents: read
env:
TEST_SUITE: local-runner
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install Nix
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Load Nix
run: nix develop -c sh -c "cd lib &&go mod download"
- name: Setup environment
uses: goplugin/plugin-github-actions/plugin-testing-framework/setup-run-tests-environment@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
go_mod_path: go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
go_necessary: false
- name: Run Tests
env:
LOCAL_CHARTS: true
uses: goplugin/plugin-github-actions/plugin-testing-framework/run-tests@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
cl_repo: ${{ env.PLUGIN_IMAGE }}
cl_image_tag: ${{ env.PLUGIN_VERSION }}
test_command_to_run: |
unset ENV_JOB_IMAGE
nix develop -c sh -c "cd lib && make k8s_test_e2e_ci"
artifacts_location: ./e2e/logs
publish_check_name: E2E Test Results
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
run_setup: false
- name: Upload test log
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: failure()
with:
name: test-log
path: /tmp/gotest.log
e2e_remote_runner_tests:
runs-on: ubuntu-latest
environment: integration
needs: [build_tests]
permissions:
id-token: write
contents: read
env:
TEST_SUITE: remote-runner
TEST_TRIGGERED_BY: plugin-testing-framework-remote-runner-ci
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Install Nix
uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Load Nix
run: nix develop -c sh -c "cd lib && go mod download"
- name: Setup environment
uses: goplugin/plugin-github-actions/plugin-testing-framework/setup-run-tests-environment@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
go_mod_path: go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
go_necessary: false
- name: Run Remote Runner Tests
uses: goplugin/plugin-github-actions/plugin-testing-framework/run-tests@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
with:
cl_repo: ${{ env.PLUGIN_IMAGE }}
cl_image_tag: ${{ env.PLUGIN_VERSION }}
test_command_to_run: |
nix develop -c sh -c "cd lib && make k8s_test_e2e_ci_remote_runner"
artifacts_location: ./k8s/logs
publish_check_name: E2E Remote Runner Test Results
token: ${{ secrets.GITHUB_TOKEN }}
go_mod_path: go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
run_setup: false
- name: Upload test log
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: failure()
with:
name: remote-runner-test-log
path: /tmp/remoterunnergotest.log