add basic cicd build pipeline (#34)

This commit is contained in:
Josh Bradley 2024-06-27 23:55:09 -04:00 committed by GitHub
parent 3624d9446d
commit 63a0f67230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 69 additions and 3 deletions

View File

@ -5,6 +5,8 @@ pool:
vmImage: ubuntu-latest vmImage: ubuntu-latest
steps: 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: | - script: |
pip install toml-to-requirements pip install toml-to-requirements
toml-to-req --toml-file pyproject.toml --poetry --optional-lists dev,test,backend,frontend toml-to-req --toml-file pyproject.toml --poetry --optional-lists dev,test,backend,frontend

67
.github/workflows/dev.yaml vendored Normal file
View File

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

View File

@ -4,7 +4,6 @@
import inspect import inspect
import json import json
import os import os
import traceback
from queue import Queue from queue import Queue
from threading import Thread from threading import Thread

View File

@ -4,7 +4,6 @@
import asyncio import asyncio
import inspect import inspect
import os import os
import traceback
from typing import cast from typing import cast
import yaml import yaml

View File

@ -2,7 +2,6 @@
# Licensed under the MIT License. # Licensed under the MIT License.
import os import os
import traceback
from fastapi import ( from fastapi import (
Depends, Depends,