-
Notifications
You must be signed in to change notification settings - Fork 161
110 lines (108 loc) · 3.91 KB
/
integration.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Integration Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
generate-stack-name:
runs-on: ubuntu-latest
outputs:
stack-name: ${{ steps.generate-stack-name.outputs.stack-name }}
steps:
- name: Generate Stack Name
id: generate-stack-name
run: echo "::set-output name=stack-name::$(echo graph-notebook-$RANDOM)"
shell: bash
create-stack:
runs-on: ubuntu-latest
needs: generate-stack-name
steps:
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
role-session-name: IntegrationTestRunner
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install
run: |
pip install -e .
- name: Create Stack
id: create-stack
run: |
python test/integration/NeptuneIntegrationWorkflowSteps.py \
create-cfn-stack \
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
--cfn-template-url ${{ secrets.CFN_TEMPLATE_URL }} \
--cfn-s3-bucket ${{ secrets.INTEG_CFN_S3_BUCKET }} \
--cfn-runner-role ${{ secrets.CFN_ROLE }} \
--aws-region ${{ secrets.AWS_REGION }}
run-tests:
runs-on: ubuntu-latest
needs: [generate-stack-name, create-stack]
steps:
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
role-session-name: IntegrationTestRunner
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install
run: |
pip install -e .
- name: Give user /etc/hosts permission
run: |
sudo chmod 777 /etc/hosts
- name: Generate test configuration
run: |
python test/integration/NeptuneIntegrationWorkflowSteps.py generate-config \
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
--aws-region ${{ secrets.AWS_REGION }}
- name: Run Basic Tests
env:
GRAPH_NOTEBOK_CONFIG: /tmp/graph_notebook_config_integration_test.json
run: |
pytest test/integration/without_iam
- name: Generate iam test configuration
run: |
python test/integration/NeptuneIntegrationWorkflowSteps.py generate-config \
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
--aws-region ${{ secrets.AWS_REGION }} \
--iam
- name: Run IAM Tests
env:
GRAPH_NOTEBOK_CONFIG: /tmp/graph_notebook_config_integration_test.json
run: |
pytest test/integration/iam
- name: Cleanup
run: |
python test/integration/NeptuneIntegrationWorkflowSteps.py \
delete-cfn-stack \
--cfn-stack-name ${{ needs.generate-stack-name.outputs.stack-name }} \
--aws-region ${{ secrets.AWS_REGION }}