diff --git a/.github/workflows/azure-dev.yaml b/.github/workflows/azure-dev.yaml deleted file mode 100644 index 3b69e16..0000000 --- a/.github/workflows/azure-dev.yaml +++ /dev/null @@ -1,67 +0,0 @@ -on: - workflow_dispatch: - # push: - # # Run when commits are pushed to mainline branch (main or master) - # # Set this to the mainline branch you are using - # branches: - # - main - -# GitHub Actions workflow to deploy to Azure using azd -# To configure required secrets for connecting to Azure, simply run `azd pipeline config` - -# Set up permissions for deploying with secretless Azure federated credentials -# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication -permissions: - id-token: write - contents: read - -jobs: - build: - runs-on: ubuntu-latest - env: - AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} - AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - steps: - - name: Set up Azure Developer CLI - uses: azure/setup-azd@v0.1.0 - - name: Checkout - uses: actions/checkout@v3 - - - name: Log in with Azure (Federated Credentials) - if: ${{ env.AZURE_CLIENT_ID != '' }} - run: | - azd auth login ` - --client-id "$Env:AZURE_CLIENT_ID" ` - --federated-credential-provider "github" ` - --tenant-id "$Env:AZURE_TENANT_ID" - shell: pwsh - - - name: Log in with Azure (Client Credentials) - if: ${{ env.AZURE_CREDENTIALS != '' }} - run: | - $info = $Env:AZURE_CREDENTIALS | ConvertFrom-Json -AsHashtable; - Write-Host "::add-mask::$($info.clientSecret)" - - azd auth login ` - --client-id "$($info.clientId)" ` - --client-secret "$($info.clientSecret)" ` - --tenant-id "$($info.tenantId)" - shell: pwsh - env: - AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - - - name: Provision Infrastructure - run: azd provision --no-prompt - env: - AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} - AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} - - - name: Deploy Application - run: azd deploy --no-prompt - env: - AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} - AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml deleted file mode 100644 index 194d138..0000000 --- a/.github/workflows/playwright.yaml +++ /dev/null @@ -1,72 +0,0 @@ -name: Run Playwright tests -on: - workflow_dispatch: - # push: - # branches: - # - main - # pull_request: - # branches: - # - main - # paths-ignore: - # - '**.md' - # - 'lab/**' - # - 'assets/**' - - - - -jobs: - # Label of the container job - Create-Container: - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - container: python:3.11 - - # Service containers to run with `container-job` - services: - # Label used to access the service container - postgres: - # Docker Hub image - image: postgres - # Provide the password for postgres - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: relecloud - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v3 - - # Performs a clean installation of all dependencies in the `package.json` file - # For more information, see https://docs.npmjs.com/cli/ci.html - - name: Install dependencies - run: | - python -m pip install -r requirements-dev.txt - playwright install - playwright install-deps - - name: Run migrations and Playwright tests - # Runs a script that creates a PostgreSQL table, populates - # the table with data, and then retrieves the data. - run: | - cd demo-code - python manage.py migrate - python manage.py collectstatic - python manage.py test relecloud.playwright - # Environment variables used by the `client.js` script to create a new PostgreSQL table. - env: - # The hostname used to communicate with the PostgreSQL service container - POSTGRES_HOST: postgres - POSTGRES_DB: relecloud - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - # The default PostgreSQL port - POSTGRES_PORT: 5432 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index cf51e3a..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Run Django Unittests -on: - workflow_dispatch: - # push: - # branches: - # - main - # pull_request: - # branches: - # - main - # paths-ignore: - # - '**.md' - # - 'lab/**' - # - 'assets/**' - - -jobs: - # Label of the container job - Create-Container: - # Containers must run in Linux based operating systems - runs-on: ubuntu-latest - # Docker Hub image that `container-job` executes in - container: python:3.11 - - # Service containers to run with `container-job` - services: - # Label used to access the service container - postgres: - # Docker Hub image - image: postgres - # Provide the password for postgres - env: - POSTGRES_PASSWORD: postgres - POSTGRES_USER: postgres - POSTGRES_DB: relecloud - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - # Downloads a copy of the code in your repository before running CI tests - - name: Check out repository code - uses: actions/checkout@v3 - - # Performs a clean installation of all dependencies in the `package.json` file - # For more information, see https://docs.npmjs.com/cli/ci.html - - name: Install dependencies - run: python -m pip install -r requirements-dev.txt - - - name: Connect to PostgreSQL - # Runs a script that creates a PostgreSQL table, populates - # the table with data, and then retrieves the data. - run: | - cd demo-code - python manage.py migrate - python manage.py collectstatic --no-input - python manage.py test - python -m pytest relecloud/tests.py - # Environment variables used by the `client.js` script to create a new PostgreSQL table. - env: - # The hostname used to communicate with the PostgreSQL service container - POSTGRES_HOST: postgres - POSTGRES_DB: relecloud - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - # The default PostgreSQL port - POSTGRES_PORT: 5432 diff --git a/.vscode/launch.json b/.vscode/launch.json index 97d03e8..f1aa0c4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,15 +4,15 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Python: FastAPI", - "type": "python", - "request": "launch", - "module": "uvicorn", - "args": [ - "fastapi_app:app", - "--reload" - ], - } + { + "name": "Python: FastAPI", + "type": "python", + "request": "launch", + "module": "uvicorn", + "args": [ + "fastapi_app:app", + "--reload" + ], + } ] } \ No newline at end of file