-
Notifications
You must be signed in to change notification settings - Fork 55
93 lines (81 loc) · 2.66 KB
/
tests.yml
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
name: Execute Tests
on:
workflow_dispatch:
pull_request:
paths:
- bin/gcloud/*
- internal/*
branches:
- dev
env:
GCLOUD_SERVICE_KEY: ${{ secrets.GCLOUD_SERVICE_KEY }}
CLOUDSDK_CORE_PROJECT: ${{ secrets.CLOUDSDK_CORE_PROJECT }}
CLOUDSDK_COMPUTE_ZONE: "europe-west2-b"
NEO4J_DOCKER_IMG: "neo4j:5.16.0-enterprise"
GO_TEST_COUNT: 1
GO_TEST_TIMEOUT: 20m
GO_TEST_FORMAT: json
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID_BACKUP }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_BACKUP }}
jobs:
gke-setup:
name: Setup GKE
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Authenticate Service Account
id: serviceAccount
run: |
CURRENT_DATE=$(date +'%Y-%m-%d')
echo "CLOUDSDK_CONTAINER_CLUSTER=ghactions-${CURRENT_DATE}" >> $GITHUB_ENV
echo "CLOUDSDK_CONTAINER_CLUSTER=ghactions-${CURRENT_DATE}" >> $GITHUB_OUTPUT
echo ${CLOUDSDK_CONTAINER_CLUSTER} > cluster_name.txt
./bin/gcloud/auth
# - name: Upload cluster name
# uses: actions/upload-artifact@v4
# with:
# name: gke_cluster_name
# path: cluster_name.txt
- name: Create GKE Cluster
run: |
./bin/gcloud/create_cluster
outputs:
CLOUDSDK_CONTAINER_CLUSTER: ${{ steps.serviceAccount.outputs.CLOUDSDK_CONTAINER_CLUSTER }}
# - name: Delete GKE Cluster
# run: |
# ./bin/gcloud/delete_cluster
run-enterprise-tests:
name: Execute enterprise tests
needs:
- gke-setup
runs-on: ubuntu-latest
env:
NEO4J_EDITION: enterprise
container:
image: neo4jbuildservice/helm-charts-tester:githubactions
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Download math result for job 1
# uses: actions/download-artifact@v4
# with:
# name: gke_cluster_name
- id: 'gcloud-auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCLOUD_SERVICE_KEY }}'
# - name: Get Cluster Name
# run: |
# CLOUDSDK_CONTAINER_CLUSTER=$(cat "cluster_name.txt")
# echo ${CLOUDSDK_CONTAINER_CLUSTER} >> $GITHUB_ENV
- id: 'get-credentials'
uses: 'google-github-actions/get-gke-credentials@v2'
with:
cluster_name: ${{ needs.gke-setup.outputs.CLOUDSDK_CONTAINER_CLUSTER }}
location: ${{ env.CLOUDSDK_COMPUTE_ZONE }}
- name: Run Integration tests
uses: ./bin/run-go-tests