Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/time-tracker-v1-on-pull-request-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Time Tacker V1 CI

on:
pull_request:
branches: [master]

jobs:
time-tracker-ci:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.9]

steps:
- name: Checking out code from the repository
uses: actions/checkout@v2

- name: Setting up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/time_tracker_api/dev.txt
pip install -r requirements/time_tracker_events/dev.txt

- name: Login to azure
uses: Azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Get vault from azure
uses: Azure/get-keyvault-secrets@v1
with:
keyvault: "time-tracker-secrets"
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"
id: timeTrackerAzureVault

- name: Run tests
env:
MS_AUTHORITY: ${{ steps.timeTrackerAzureVault.outputs.MS-AUTHORITY }}
MS_CLIENT_ID: ${{ steps.timeTrackerAzureVault.outputs.MS-CLIENT-ID }}
MS_SCOPE: ${{ steps.timeTrackerAzureVault.outputs.MS-SCOPE }}
MS_SECRET: ${{ steps.timeTrackerAzureVault.outputs.MS-SECRET }}
MS_ENDPOINT: ${{ steps.timeTrackerAzureVault.outputs.MS-ENDPOINT }}
USERID: ${{ steps.timeTrackerAzureVault.outputs.USERID }}
AZURE_APP_CONFIGURATION_CONNECTION_STRING: ${{ steps.timeTrackerAzureVault.outputs.AZURE-APP-CONFIGURATION-CONNECTION-STRING }}
DATABASE_ACCOUNT_URI: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-ACCOUNT-URI }}
DATABASE_MASTER_KEY: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-MASTER-KEY }}
DATABASE_NAME: ${{ steps.timeTrackerAzureVault.outputs.DATABASE-NAME }}
AZURE_STORAGE_ACCOUNT_KEY: ${{ steps.timeTrackerAzureVault.outputs.AZURE-STORAGE-ACCOUNT-KEY }}
run: |
pytest tests

- name: Test the build of the app
run: |
docker build .