Skip to content

Commit a6fcb35

Browse files
author
Cristian Toaquiza
authored
ci: TT-411 adds pull request (ci) workflow for time-tracker v1 (#356)
* ci: [TT-412] adds ci workflow for time-tracker v1 * ci: [TT-412] injects secrets * ci: [TT-412] gets azure vault * ci: [TT-412] logins to azure * ci: [TT-412] adds other attempt to use secrets * ci: [TT-412] adds other attempt to use secrets as env var * ci: [TT-412] injects secrets to run tests * ci: [TT-412] injects USERID to run tests * ci: [TT-412] injects AZURE-APP-CONFIGURATION-CONNECTION-STRING to run tests * ci: [TT-412] injects DATABASE-ACCOUNT-URI to run tests * ci: [TT-412] injects DATABASE-MASTER-KEYO to run tests * ci: [TT-412] injects DATABASE-NAME to run tests * ci: [TT-412] injects AZURE-STORAGE-ACCOUNT-KEY to run tests * ci: [TT-412] adds step to build the app * ci: [TT-412] updates on section values * ci: [TT-412] renames file
1 parent 60a0dc7 commit a6fcb35

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Time Tacker V1 CI
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
time-tracker-ci:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
python-version: [3.9]
14+
15+
steps:
16+
- name: Checking out code from the repository
17+
uses: actions/checkout@v2
18+
19+
- name: Setting up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements/time_tracker_api/dev.txt
28+
pip install -r requirements/time_tracker_events/dev.txt
29+
30+
- name: Login to azure
31+
uses: Azure/login@v1
32+
with:
33+
creds: ${{ secrets.AZURE_CREDENTIALS }}
34+
35+
- name: Get vault from azure
36+
uses: Azure/get-keyvault-secrets@v1
37+
with:
38+
keyvault: "time-tracker-secrets"
39+
secrets: "MS-CLIENT-ID, MS-AUTHORITY, MS-SCOPE, MS-SECRET, MS-ENDPOINT, USERID, AZURE-APP-CONFIGURATION-CONNECTION-STRING, DATABASE-ACCOUNT-URI, DATABASE-MASTER-KEY, DATABASE-NAME, AZURE-STORAGE-ACCOUNT-KEY"
40+
id: timeTrackerAzureVault
41+
42+
- name: Run tests
43+
env:
44+
MS_AUTHORITY: ${{ steps.timeTrackerAzureVault.outputs.MS-AUTHORITY }}
45+
MS_CLIENT_ID: ${{ steps.timeTrackerAzureVault.outputs.MS-CLIENT-ID }}
46+
MS_SCOPE: ${{ steps.timeTrackerAzureVault.outputs.MS-SCOPE }}
47+
MS_SECRET: ${{ steps.timeTrackerAzureVault.outputs.MS-SECRET }}
48+
MS_ENDPOINT: ${{ steps.timeTrackerAzureVault.outputs.MS-ENDPOINT }}
49+
USERID: ${{ steps.timeTrackerAzureVault.outputs.USERID }}
50+
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ steps.timeTrackerAzureVault.outputs.AZURE-APP-CONFIGURATION-CONNECTION-STRING }}
51+
DATABASE_ACCOUNT_URI: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-ACCOUNT-URI }}
52+
DATABASE_MASTER_KEY: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-MASTER-KEY }}
53+
DATABASE_NAME: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-NAME }}
54+
AZURE_STORAGE_ACCOUNT_KEY: ${{ steps.timeTrackerAzureVault.outputs.AZURE-STORAGE-ACCOUNT-KEY }}
55+
run: |
56+
pytest tests
57+
58+
- name: Test the build of the app
59+
run: |
60+
docker build .

0 commit comments

Comments
 (0)