Skip to content

Commit 4cccfd6

Browse files
committed
Add Github actions workflow
1 parent 284f2fa commit 4cccfd6

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
testInfraRepo:
15+
description: 'Git repository for checking out the test-infra repo'
16+
required: false
17+
default: 'aws-controllers-k8s/test-infra'
18+
testInfraRef:
19+
description: 'Git ref for checking out the test-infra repo. Default is main'
20+
required: false
21+
default: ''
22+
23+
jobs:
24+
e2e-test:
25+
name: controller e2e test
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
service:
30+
- ecr
31+
runs-on: [aws-controllers-k8s]
32+
steps:
33+
- name: Set up Go 1.15
34+
uses: actions/setup-go@v2
35+
with:
36+
go-version: ^1.15
37+
id: go
38+
39+
- name: checkout service
40+
uses: actions/checkout@v2
41+
with:
42+
path: './src/github.com/aws-controllers-k8s/${{ matrix.service }}-controller'
43+
44+
- name: checkout community
45+
uses: actions/checkout@v2
46+
with:
47+
repository: ${{ github.event.inputs.communityRepo }}
48+
ref: ${{ github.event.inputs.communityRef }}
49+
path: './src/github.com/aws-controllers-k8s/community'
50+
51+
- name: checkout test-infra
52+
uses: actions/checkout@v2
53+
with:
54+
repository: ${{ github.event.inputs.testInfraRepo }}
55+
ref: ${{ github.event.inputs.testInfraRef }}
56+
path: './src/github.com/aws-controllers-k8s/test-infra'
57+
58+
- name: execute e2e tests
59+
working-directory: './src/github.com/aws-controllers-k8s/community'
60+
run: |
61+
export AWS_ROLE_ARN=$(aws ssm get-parameter --name ACK_ROLE_ARN --query "Parameter.Value" --output text)
62+
export AWS_ROLE_ARN_ALT=$(aws ssm get-parameter --name ACK_ROLE_ARN_ALT --query "Parameter.Value" --output text)
63+
./scripts/kind-build-test.sh $SERVICE
64+
env:
65+
SERVICE: ${{ matrix.service }}
66+
GOPATH: ${{ github.workspace }}
67+
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)