|
| 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