Skip to content

Commit

Permalink
add basic cicd build pipeline (Azure-Samples#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgbradley1 authored Jun 28, 2024
1 parent 3624d94 commit 63a0f67
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .azdo/azure-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pool:
vmImage: ubuntu-latest

steps:
# Component Governance does not support pyproject.toml yet.
# For that reason, use toml-to-requirements to export dependencies into a requirements.txt file.
- script: |
pip install toml-to-requirements
toml-to-req --toml-file pyproject.toml --poetry --optional-lists dev,test,backend,frontend
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Dev Build
on:
workflow_dispatch: # triggered manually via the GitHub UI
pull_request: # triggered when a PR is created or updated
types:
- opened
- reopened
- synchronize
- ready_for_review
paths: # only trigger on changes in specific directories
- '.github/**/*.yaml'
- 'backend/**'
- 'docker/**'
- 'infra/**'
- 'poetry.lock'
- 'pyproject.toml'
jobs:
lint-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install ruff
- run: |
ruff check
build-devcontainer:
needs: [lint-check]
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: .devcontainer
push: false
build-backend:
needs: [lint-check]
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-backend
push: false
build-frontend:
needs: [lint-check]
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build docker image
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile-frontend
push: false
1 change: 0 additions & 1 deletion backend/src/api/experimental.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import inspect
import json
import os
import traceback
from queue import Queue
from threading import Thread

Expand Down
1 change: 0 additions & 1 deletion backend/src/api/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import asyncio
import inspect
import os
import traceback
from typing import cast

import yaml
Expand Down
1 change: 0 additions & 1 deletion backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Licensed under the MIT License.

import os
import traceback

from fastapi import (
Depends,
Expand Down

0 comments on commit 63a0f67

Please sign in to comment.