Skip to content

Commit 69ba7f1

Browse files
author
Nicholas Thomson
committed
Add Github workflows
1 parent 4c26500 commit 69ba7f1

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: e2e-test
2+
on:
3+
# Allow manual trigger of e2e tests
4+
workflow_dispatch:
5+
inputs:
6+
communityRepo:
7+
description: 'Git repository for checking out the community repo'
8+
required: false
9+
default: 'aws-controllers-k8s/community'
10+
communityRef:
11+
description: 'Git ref for checking out the community repo. Default is main'
12+
required: false
13+
default: ''
14+
codeGeneratorRepo:
15+
description: 'Git repository for checking out the code-generator repo'
16+
required: false
17+
default: 'aws-controllers-k8s/code-generator'
18+
codeGeneratorRef:
19+
description: 'Git ref for checking out the code-generator repo. Default is main'
20+
required: false
21+
default: ''
22+
testInfraRepo:
23+
description: 'Git repository for checking out the test-infra repo'
24+
required: false
25+
default: 'aws-controllers-k8s/test-infra'
26+
testInfraRef:
27+
description: 'Git ref for checking out the test-infra repo. Default is main'
28+
required: false
29+
default: ''
30+
31+
jobs:
32+
e2e-test:
33+
name: controller e2e test
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
service:
38+
- apigatewayv2
39+
runs-on: [aws-controllers-k8s]
40+
steps:
41+
- name: Set up Go 1.15
42+
uses: actions/setup-go@v2
43+
with:
44+
go-version: ^1.15
45+
id: go
46+
47+
- name: checkout service
48+
uses: actions/checkout@v2
49+
with:
50+
path: './src/github.com/aws-controllers-k8s/${{ matrix.service }}-controller'
51+
52+
- name: checkout community
53+
uses: actions/checkout@v2
54+
with:
55+
repository: ${{ github.event.inputs.communityRepo }}
56+
ref: ${{ github.event.inputs.communityRef }}
57+
path: './src/github.com/aws-controllers-k8s/community'
58+
59+
- name: checkout code-generator
60+
uses: actions/checkout@v2
61+
with:
62+
repository: ${{ github.event.inputs.codeGeneratorRepo }}
63+
ref: ${{ github.event.inputs.codeGeneratorRef }}
64+
path: './src/github.com/aws-controllers-k8s/code-generator'
65+
66+
- name: checkout test-infra
67+
uses: actions/checkout@v2
68+
with:
69+
repository: ${{ github.event.inputs.testInfraRepo }}
70+
ref: ${{ github.event.inputs.testInfraRef }}
71+
path: './src/github.com/aws-controllers-k8s/test-infra'
72+
73+
- name: build controller
74+
working-directory: './src/github.com/aws-controllers-k8s/community'
75+
run: ./scripts/build-controller.sh $SERVICE
76+
env:
77+
SERVICE: ${{ matrix.service }}
78+
GOPATH: ${{ github.workspace }}
79+
80+
- name: execute e2e tests
81+
working-directory: './src/github.com/aws-controllers-k8s/community'
82+
run: |
83+
export AWS_ROLE_ARN=$(aws ssm get-parameter --name ACK_ROLE_ARN --query "Parameter.Value" --output text)
84+
export AWS_ROLE_ARN_ALT=$(aws ssm get-parameter --name ACK_ROLE_ARN_ALT --query "Parameter.Value" --output text)
85+
./scripts/kind-build-test.sh $SERVICE
86+
env:
87+
SERVICE: ${{ matrix.service }}
88+
GOPATH: ${{ github.workspace }}
89+
PRESERVE: 'false'

.github/workflows/unit-test.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: unit-test
2+
on:
3+
# Allow manual trigger
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
paths:
9+
- '**.go'
10+
- Makefile
11+
- go.mod
12+
- go.sum
13+
14+
jobs:
15+
build:
16+
name: make test
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: checkout code
20+
uses: actions/checkout@v2
21+
- uses: actions/setup-go@v2
22+
with:
23+
go-version: '1.15'
24+
- name: make test
25+
run: make test

0 commit comments

Comments
 (0)