Skip to content

Commit d57e7d4

Browse files
authored
Merge pull request #4 from lambda-feedback/feature/database-testing
Feature/database testing
2 parents 9031f88 + bf4fc45 commit d57e7d4

File tree

5 files changed

+198
-2
lines changed

5 files changed

+198
-2
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
blank_issues_enabled: false
2+
contact_links: []
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "Release Request"
2+
description: "Request a deployment by specifying the evaluation function, changes, target commit/branch, and test confirmation."
3+
title: "Release Request"
4+
labels:
5+
- release
6+
- deployment
7+
assignees: []
8+
body:
9+
- type: textarea
10+
id: description_of_changes
11+
attributes:
12+
label: Description of changes
13+
description: "Summarize what is changing and why. Include links to PRs, issues, or changelogs."
14+
placeholder: |
15+
- What changed:
16+
- Why:
17+
- Related PRs/Issues: #123, #456
18+
render: markdown
19+
validations:
20+
required: true
21+
22+
- type: input
23+
id: branch_to_deploy
24+
attributes:
25+
label: Branch to deploy
26+
description: |
27+
Specify Branch name to deploy.
28+
placeholder: "e.g., release/2025-09-29"
29+
validations:
30+
required: true
31+
32+
- type: dropdown
33+
id: version-bump
34+
attributes:
35+
label: "🚀 What kind of update is this?"
36+
description: "Tell us how significant this change is. This helps us set the correct new version number."
37+
options:
38+
- "Patch: A small fix for a bug. It won't break anything for existing users. (e.g., 1.2.3 ➔ 1.2.4)"
39+
- "Minor: Adds a new feature, but doesn't change how existing ones work. A safe update. (e.g., 1.2.3 ➔ 1.3.0)"
40+
- "Major: A big change that alters existing features. Users may need to update their work to adapt. (e.g., 1.2.3 ➔ 2.0.0)"
41+
default: 0
42+
validations:
43+
required: true
44+
45+
- type: markdown
46+
attributes:
47+
value: |
48+
---
49+
### ⚡ Click the Link Below to Run the Workflow
50+
51+
Clicking the link will take you to the Actions page. You will need to click the **"Run workflow"** button there to start the process.
52+
53+
## [➡️ Go to Workflow Run Page](../actions/workflows/production-deploy.yml)

.github/workflows/deploy.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
28+
lfs: true
29+
- name: pull lfs files
30+
run: git lfs pull
2831

2932
- name: Set up Python ${{ matrix.python-version }}
3033
id: python-setup
@@ -88,13 +91,13 @@ jobs:
8891
contents: read
8992
id-token: write
9093
packages: write
91-
94+
9295
deploy:
9396
name: Deploy to Lambda Feedback
9497
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@main
9598
needs: test
9699
with:
97-
template-repository-name: "lambda-feedback/evaluation-function-boilerplate-wolfram"
100+
template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python"
98101
permissions:
99102
contents: read
100103
id-token: write
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Production Version to Lambda Feedback
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version-bump:
7+
description: 'Version bump type'
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
default: patch
15+
branch:
16+
description: 'Branch to release from'
17+
required: true
18+
type: string
19+
default: 'main'
20+
jobs:
21+
deploy:
22+
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request
23+
with:
24+
template-repository-name: 'lambda-feedback/evaluation-function-boilerplate-wolfram'
25+
environment: "production"
26+
version-bump: ${{ inputs.version-bump }}
27+
branch: ${{ inputs.branch }}
28+
run-tests: true
29+
30+
secrets:
31+
aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
32+
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}
33+
function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}}
34+
gcp_credentials: ${{ secrets.GCP_DEPLOY }}
35+
TEST_API_ENDPOINT: ${{ secrets.TEST_API_ENDPOINT }}
36+
DB_USER: ${{ secrets.DB_USER }}
37+
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
38+
DB_HOST: ${{ secrets.DB_HOST }}
39+
DB_PORT: ${{ secrets.DB_PORT }}
40+
DB_NAME: ${{ secrets.DB_NAME }}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Deploy to Lambda Feedback
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
actions: read
17+
checks: write
18+
pull-requests: write
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: ["3.12"]
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
lfs: true
29+
- name: pull lfs files
30+
run: git lfs pull
31+
- name: Verify LFS files
32+
run: git lfs ls-files
33+
- name: Set up Python ${{ matrix.python-version }}
34+
id: python-setup
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Load cached Poetry installation
40+
id: poetry-cache
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.local
44+
key: poetry-0
45+
46+
- name: Install and configure Poetry
47+
if: steps.poetry-cache.outputs.cache-hit != 'true'
48+
uses: snok/install-poetry@v1
49+
with:
50+
virtualenvs-in-project: true
51+
52+
- name: Load cached venv
53+
id: dependencies-cache
54+
uses: actions/cache@v3
55+
with:
56+
path: .venv
57+
key: venv-${{ runner.os }}-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
58+
59+
- name: Install dependencies
60+
if: steps.dependencies-cache.outputs.cache-hit != 'true'
61+
run: |
62+
poetry install --with dev --no-interaction --no-root
63+
64+
# TODO: add linting / black / flake8
65+
# - name: Lint with flake8
66+
# run: |
67+
# source .venv/bin/activate
68+
# # stop the build if there are Python syntax errors or undefined names
69+
# flake8 ./evaluation_function --count --select=E9,F63,F7,F82 --show-source --statistics
70+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
71+
# flake8 ./evaluation_function --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
72+
73+
- name: Run tests
74+
if: always()
75+
run: |
76+
source .venv/bin/activate
77+
pytest --junit-xml=./reports/pytest.xml --tb=auto -v
78+
79+
- name: Upload test results
80+
uses: actions/upload-artifact@v4
81+
if: always()
82+
with:
83+
name: test-results
84+
path: ./reports/pytest.xml
85+
if-no-files-found: warn
86+
deploy:
87+
needs: test
88+
uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request
89+
with:
90+
template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python"
91+
build-platforms: "aws"
92+
environment: "staging"
93+
lfs: true
94+
secrets:
95+
aws-key-id: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_ID }}
96+
aws-secret-key: ${{ secrets.LAMBDA_CONTAINER_PIPELINE_AWS_SECRET}}
97+
function-admin-api-key: ${{ secrets.FUNCTION_ADMIN_API_KEY}}
98+
gcp_credentials: ${{ secrets.GCP_DEPLOY }}

0 commit comments

Comments
 (0)