forked from txpipe/oura
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (95 loc) · 3.36 KB
/
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
on:
workflow_dispatch: {}
name: e2e
env:
REGISTRY: ghcr.io
TARGET_IMAGE: ghcr.io/txpipe/oura-e2e:${{ github.sha }}
CLUSTER: m1-prod-6x3kk4
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ env.TARGET_IMAGE }}
prepare:
needs: ["build"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ClusterAdminRole
role-session-name: Github-e2e-Rollout
role-duration-seconds: 1200
- uses: azure/setup-kubectl@v4
with:
version: "v1.23.6"
- name: Login to EKS
run: aws eks update-kubeconfig --name ${CLUSTER}
- name: Create Namespace
run: kubectl create namespace e2e-${GITHUB_RUN_NUMBER}
- name: Create Service Account
working-directory: .github/e2e
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
run: envsubst < serviceaccount.yaml | kubectl apply -n e2e-${GITHUB_RUN_NUMBER} -f -
test:
needs: ["prepare"]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: assert-n2c-preview-origin-blocks
- name: assert-n2c-preview-tip-blocks
- name: assert-n2n-mainnet-origin-blocks
- name: assert-n2n-mainnet-tip-blocks
- name: assert-n2n-preview-origin-blocks
- name: assert-n2n-preview-tip-blocks
- name: aws-lambda-10-blocks
- name: aws-s3-500-blocks
- name: aws-sqs-10-blocks
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/ClusterAdminRole
role-session-name: Github-e2e-Rollout
role-duration-seconds: 3600
- uses: azure/setup-kubectl@v4
with:
version: "v1.23.6"
- name: Login to EKS
run: aws eks update-kubeconfig --name ${CLUSTER}
- name: Rollout Job
working-directory: .github/e2e
env:
TEST_NAME: ${{ matrix.name }}
run: |+
envsubst < ${TEST_NAME}.yaml | kubectl apply -n e2e-${GITHUB_RUN_NUMBER} -f -
- name: Wait for Completion
env:
TEST_NAME: ${{ matrix.name }}
run: |+
kubectl wait --for=condition=complete --timeout=1800s job ${TEST_NAME} -n e2e-${GITHUB_RUN_NUMBER}
kubectl get job ${TEST_NAME} -o jsonpath={.status.succeeded} -n e2e-${GITHUB_RUN_NUMBER}