-
Notifications
You must be signed in to change notification settings - Fork 51
137 lines (122 loc) · 4.61 KB
/
integration.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Integration tests
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: {}
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
lint:
name: Lint code
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dir
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-cache-${{ matrix.python-version }}-lint
- name: Install required packages
run: pip install tox
- name: Run tox
run: tox -e lint
integration:
# Name the Job
name: Per-cloud integration tests
needs: lint
# Set the type of machine to run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
cloud-provider: ['aws', 'azure', 'gcp', 'mock', 'openstack']
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dir
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
- name: Install required packages
run: pip install tox
- name: Run tox
id: tox
run: tox -e py${{ matrix.python-version }}-${{ matrix.cloud-provider }}
env:
PYTHONUNBUFFERED: "True"
# aws
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
CB_VM_TYPE_AWS: ${{ secrets.CB_VM_TYPE_AWS }}
# azure
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_SECRET: ${{ secrets.AZURE_SECRET }}
AZURE_TENANT: ${{ secrets.AZURE_TENANT }}
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
CB_IMAGE_AZURE: ${{ secrets.CB_IMAGE_AZURE }}
CB_VM_TYPE_AZURE: ${{ secrets.CB_VM_TYPE_AZURE }}
# gcp
GCP_SERVICE_CREDS_DICT: ${{ secrets.GCP_SERVICE_CREDS_DICT }}
CB_IMAGE_GCP: ${{ secrets.CB_IMAGE_GCP }}
CB_VM_TYPE_GCP: ${{ secrets.CB_VM_TYPE_GCP }}
# openstack
OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_PROJECT_DOMAIN_NAME: ${{ secrets.OS_PROJECT_DOMAIN_NAME }}
OS_TENANT_NAME: ${{ secrets.OS_TENANT_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
OS_USER_DOMAIN_NAME: ${{ secrets.OS_USER_DOMAIN_NAME }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
CB_IMAGE_OS: ${{ secrets.CB_IMAGE_OS }}
CB_VM_TYPE_OS: ${{ secrets.CB_VM_TYPE_OS }}
CB_PLACEMENT_OS: ${{ secrets.CB_PLACEMENT_OS }}
- name: Create Build Status Badge
if: github.ref == 'refs/heads/master'
uses: schneegans/dynamic-badges-action@v1.1.0
with:
auth: ${{ secrets.BUILD_STATUS_GIST_SECRET }}
gistID: ${{ secrets.BUILD_STATUS_GIST_ID }}
filename: cloudbridge_py${{ matrix.python-version }}_${{ matrix.cloud-provider }}.json
label: ${{ matrix.cloud-provider }}
message: ${{ fromJSON('["passing", "failing"]')[steps.tox.outcome != 'success'] }}
color: ${{ fromJSON('["green", "red"]')[steps.tox.outcome != 'success'] }}
- name: Coveralls
if: ${{ steps.tox.outcome == 'success' }}
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
parallel: true
finish:
needs: integration
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true