forked from wso2/reference-implementations-afm
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (76 loc) · 2.5 KB
/
langchain-interpreter.yml
File metadata and controls
89 lines (76 loc) · 2.5 KB
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
name: LangChain Interpreter CI
on:
push:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"
pull_request:
branches: [main, dev]
paths:
- "langchain-interpreter/**"
- ".github/workflows/langchain-interpreter.yml"
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: langchain-interpreter
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install dependencies
run: uv sync --dev
- name: Run tests
run: uv run pytest
- name: Lint with ruff
run: uv run ruff check .
docker:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
packages: write
defaults:
run:
working-directory: langchain-interpreter
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine image name
id: meta
env:
OWNER: ${{ github.repository_owner }}
run: |
# GHCR requires lowercase repository names
OWNER_LOWER=$(echo "$OWNER" | tr '[:upper:]' '[:lower:]')
echo "image_name=ghcr.io/$OWNER_LOWER/afm-langchain-interpreter" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: langchain-interpreter
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ steps.meta.outputs.image_name }}:latest
${{ steps.meta.outputs.image_name }}:${{ github.sha }}
labels: |
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=AFM LangChain Interpreter
org.opencontainers.image.licenses=Apache-2.0
annotations: |
index:org.opencontainers.image.source=https://github.com/${{ github.repository }}
index:org.opencontainers.image.licenses=Apache-2.0