This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (65 loc) · 2.4 KB
/
build_test_deploy.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
name: Build, Test and Deploy
on:
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *'
jobs:
linux-build-and-test:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
lfs: true
- name: Set Up Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: inference
environment-file: ./environment.yml
- name: flake8
shell: bash -l {0}
run: |
conda activate inference
flake8 . --count --exit-zero --statistics
- name: mypy
shell: bash -l {0}
run: |
conda activate inference
find . -type f -name "*.py" | xargs mypy
- name: Test with pytest
shell: bash -l {0}
env:
CUSTOMCONNSTR_AZUREML_SERVICE_PRINCIPAL_SECRET: ${{ secrets.CUSTOMCONNSTR_AZUREML_SERVICE_PRINCIPAL_SECRET }}
CUSTOMCONNSTR_API_AUTH_SECRET: ${{ secrets.CUSTOMCONNSTR_API_AUTH_SECRET }}
CLUSTER: "training-nc12"
WORKSPACE_NAME: "InnerEye-DeepLearning"
EXPERIMENT_NAME: "api_inference"
RESOURCE_GROUP: "InnerEye-DeepLearning"
SUBSCRIPTION_ID: ${{ secrets.SUBSCRIPTION_ID }}
APPLICATION_ID: ${{ secrets.APPLICATION_ID }}
TENANT_ID: ${{ secrets.TENANT_ID }}
DATASTORE_NAME: "inferencetestimagestore"
IMAGE_DATA_FOLDER: "temp-image-store"
run: |
conda activate inference
pytest --cov=./ --cov-report=html
test-azure-deployment:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
lfs: true
- name: Azure Login
uses: Azure/login@v1
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.SUBSCRIPTION_ID }}","tenantId":"${{ secrets.TENANT_ID }}"}'
- name: Deploy Azure App Service
uses: azure/CLI@v1
with:
azcliversion: 2.42.0
inlineScript: |
az webapp up --name innereyeinferencetest-${{ github.run_id }} --subscription "InnerEye Dev" -g InnerEye-Inference --sku S1 --location ukwest --runtime PYTHON:3.7
az webapp delete --name innereyeinferencetest-${{ github.run_id }} --subscription "InnerEye Dev" -g InnerEye-Inference