Skip to content

Commit c249808

Browse files
chore: restructure CI/CD workflows
1 parent 9a141f7 commit c249808

File tree

6 files changed

+25
-64
lines changed

6 files changed

+25
-64
lines changed

.github/actions/setup-python-env/action.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,11 @@ on:
55
secrets:
66
token:
77
required: true
8-
inputs:
9-
folder_path:
10-
description: 'The folder path to run actions in'
11-
required: true
12-
type: string
138

149
jobs:
1510
build:
1611
name: Build and publish
17-
if: github.ref == 'refs/heads/main'
1812
runs-on: "ubuntu-24.04"
19-
defaults:
20-
run:
21-
working-directory: ${{ inputs.folder_path }}
22-
2313

2414
steps:
2515
- uses: actions/checkout@v4
@@ -39,7 +29,17 @@ jobs:
3929
run: |
4030
uv build
4131
32+
- name: Check if version in pyproject.toml was modified
33+
id: check_version
34+
run: |
35+
if git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep -q 'pyproject.toml'; then
36+
echo "modified=true" >> $GITHUB_OUTPUT
37+
else
38+
echo "modified=false" >> $GITHUB_OUTPUT
39+
fi
40+
4241
- name: "Publish"
42+
if: ${{ steps.check_version.outputs.modified }} == 'true'
4343
run: |
4444
uv publish
4545
env:

.github/workflows/cd.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: CD
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Core CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
12+
uses: ./.github/workflows/build.yml
13+
secrets:
14+
token: ${{ secrets.PYPI_TOKEN }}
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,22 @@
1-
name: Langchain CI
1+
name: Core CI
22

33
on:
44
workflow_dispatch: {}
55
push:
66
branches:
77
- main
8-
paths:
9-
- "src/**"
108
pull_request:
119
branches:
1210
- main
13-
paths:
14-
- "src/**"
1511

1612

1713
jobs:
1814
lint:
1915
uses: ./.github/workflows/lint.yml
20-
with:
21-
folder_path: "."
2216

2317
test:
2418
uses: ./.github/workflows/test.yml
25-
with:
26-
folder_path: "."
2719
secrets:
2820
UIPATH_URL: ${{ secrets.UIPATH_URL }}
2921
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
3022
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}
31-
32-
build:
33-
needs: [lint, test]
34-
uses: ./.github/workflows/build.yml
35-
with:
36-
folder_path: "."
37-
secrets:
38-
token: ${{ secrets.PYPI_TOKEN }}

.github/workflows/lint.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ name: Reusable Lint Workflow
33
on:
44
workflow_call:
55
inputs:
6-
folder_path:
7-
description: 'The folder path to run actions in'
8-
required: true
9-
type: string
106
should_skip:
117
description: 'Whether to skip the linting step'
128
required: false
@@ -18,9 +14,6 @@ jobs:
1814
name: Lint
1915
runs-on: "ubuntu-24.04"
2016
if: inputs.should_skip == false
21-
defaults:
22-
run:
23-
working-directory: ${{ inputs.folder_path }}
2417

2518

2619
steps:

.github/workflows/test.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ on:
1010
UIPATH_CLIENT_SECRET:
1111
required: true
1212
inputs:
13-
folder_path:
14-
description: 'The folder path to run actions in'
15-
required: true
16-
type: string
1713
should_skip:
1814
description: 'Whether to skip the linting step'
1915
required: false
@@ -25,9 +21,6 @@ jobs:
2521
name: Test
2622
runs-on: "ubuntu-24.04"
2723
if: inputs.should_skip == false
28-
defaults:
29-
run:
30-
working-directory: ${{ inputs.folder_path }}
3124

3225
steps:
3326
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)