diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..43eb5b0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: 'Continuous Integration' + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + pip install -r requirements.txt -r requirements-dev.txt -r requirements-test.txt + + - name: Run model tests + run: make model-test + + - name: Run API tests + run: make api-test \ No newline at end of file diff --git a/docs/challenge.md b/docs/challenge.md index 801a2cd..5934d01 100644 --- a/docs/challenge.md +++ b/docs/challenge.md @@ -122,3 +122,12 @@ The API is deployed as a Cloud Run Service that exposes a public endpoint. In or After the deployment is completed, the API is available at https://delay-model-dpmrk4cwxq-uw.a.run.app, and the prediction endpoint is available at https://delay-model-dpmrk4cwxq-uw.a.run.app/predict. We can test the service using Postman or run the provided stress test. The results of the stress test are an error rate of 0%, an average response time of 343ms, a maximum response time of 743ms and the API is able to respond to 87.69 requests per second. + + +## CI/CD Pipeline + +On this final step, the goal is to setup a proper CI/CD pipeline. + +The CI workflows focus on running the tests and assesing the quality of the code each time there's a push to the repository, with the goal of detecting bugs earlier, correcting code faster and ensuring good code quality practices. + +The CD workflows focus on training the model, deploying the API and running the stress testing against it. These workflows only run when there's a push to the `main`, `develop` or `release` branches on the repository.cua diff --git a/workflows/cd.yml b/workflows/cd.yml deleted file mode 100644 index 3029e4f..0000000 --- a/workflows/cd.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: 'Continuous Delivery' - -on: - ... - -jobs: - ... \ No newline at end of file diff --git a/workflows/ci.yml b/workflows/ci.yml deleted file mode 100644 index ec2cb7a..0000000 --- a/workflows/ci.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: 'Continuous Integration' - -on: - ... - -jobs: - ... \ No newline at end of file