-
Notifications
You must be signed in to change notification settings - Fork 5.2k
136 lines (119 loc) · 4.11 KB
/
nightly_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Run every day at midnight (UTC)
env:
POETRY_VERSION: "1.8.3"
PYTHON_VERSION: "3.12"
jobs:
create-nightly-tag:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
permissions:
# Required to create tag
contents: write
outputs:
TAG: ${{ steps.create_tag.outputs.tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: true
- name: Set up Python ${{ env.PYTHON_VERSION }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_caching"
with:
python-version: ${{ env.PYTHON_VERSION }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
poetry env use ${{ env.PYTHON_VERSION }}
poetry install
- name: Create tag
id: create_tag
run: |
git config --global user.email "jordan.frazier@datastax.com"
git config --global user.name "Langflow Bot"
TAG="$(poetry run python ./scripts/ci/pypi_nightly_tag.py)"
echo "tag=$TAG" >> $GITHUB_OUTPUT
poetry run python ./scripts/ci/update_pyproject_version.py $TAG
poetry run python ./scripts/ci/update_pyproject_name.py langflow-nightly
git add pyproject.toml
git commit -m "Update version and project name in files"
git tag -a $TAG -m "Langflow nightly $TAG"
echo "Created tag: $TAG"
git push origin $TAG || echo "Tag push failed. Check if the tag already exists."
# TODO: Slack message on failure
# TODO: update email to noreply or generic
frontend-tests:
name: Run Frontend Tests
needs: create-nightly-tag
uses: ./.github/workflows/typescript_test.yml
with:
tests_folder: "tests/end-to-end"
ref: ${{ needs.create-nightly-tag.outputs.TAG }}
secrets:
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}"
STORE_API_KEY: "${{ secrets.STORE_API_KEY }}"
backend-unit-tests:
name: Run Backend Unit Tests
needs: create-nightly-tag
uses: ./.github/workflows/python_test.yml
with:
python-versions: '["3.10", "3.11", "3.12"]'
ref: ${{ needs.create-nightly-tag.outputs.TAG }}
backend-integration-tests:
name: Run Backend Integration Tests
needs: create-nightly-tag
uses: ./.github/workflows/integration_tests.yml
with:
python-versions: '["3.10", "3.11", "3.12"]'
ref: ${{ needs.create-nightly-tag.outputs.TAG }}
release-nightly-build:
name: Run Nightly Langflow Build
needs:
[
frontend-tests,
backend-unit-tests,
backend-integration-tests,
create-nightly-tag,
]
uses: ./.github/workflows/release_nightly.yml
with:
build_docker_base: false
build_docker_main: false
nightly_tag: ${{ needs.create-nightly-tag.outputs.TAG }}
# slack-notification:
# name: Send Slack Notification
# needs: run-nightly-build
# runs-on: ubuntu-latest
# steps:
# - name: Send success notification to Slack
# if: success()
# uses: slackapi/slack-github-action@v1.26.0
# with:
# payload: |
# {
# "channel": "#langflow-nightly-builds",
# "username": "GitHub Actions",
# "text": "Nightly Build Successful :white_check_mark:",
# "icon_emoji": ":rocket:"
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
# - name: Send failure notification to Slack
# if: failure()
# uses: slackapi/slack-github-action@v1.26.0
# with:
# payload: |
# {
# "channel": "#langflow-nightly-builds",
# "username": "GitHub Actions",
# "text": "Nightly Build Failed :x:",
# "icon_emoji": ":warning:"
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}