Skip to content

Commit 3f1408a

Browse files
committed
chore: remove Azure build and test pipeline (#2)
- remove Azure build and test configuration file. - adjust PR template - adjust make file, gitignore - add github action for linting and testing
1 parent c4f810d commit 3f1408a

File tree

5 files changed

+77
-67
lines changed

5 files changed

+77
-67
lines changed

.azure/build-and-test.yaml

-62
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Additional Guidelines:
1616

1717
- Ensure your code follows established coding conventions
1818
- Include relevant tests and documentation updates.
19-
- If no one reviews your PR within a few days, please @-mention aklos.
19+
- If no one reviews your PR within a few days, please @-mention a-klos.
2020

2121
Thank you for your contribution!

.github/workflows/lint-and-test.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Lint and test workflow
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
SanitizeBranchName:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
sanitized_ref: ${{ steps.sanitize.outputs.sanitized_ref }}
14+
steps:
15+
- name: Sanitize Branch Name
16+
id: sanitize
17+
run: |
18+
SANITIZED_REF=$(echo "${GITHUB_HEAD_REF}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-')
19+
SANITIZED_REF=${SANITIZED_REF#-}
20+
SANITIZED_REF=${SANITIZED_REF%-}
21+
SANITIZED_REF=${SANITIZED_REF:0:63}
22+
if [[ -z "$SANITIZED_REF" || "$SANITIZED_REF" =~ ^-+$ ]]; then
23+
SANITIZED_REF="tmp-branch"
24+
fi
25+
echo "::set-output name=sanitized_ref::${SANITIZED_REF}"
26+
shell: bash
27+
env:
28+
GITHUB_HEAD_REF: ${{ github.head_ref }}
29+
30+
BuildAndLint:
31+
name: Build and Lint
32+
runs-on: ubuntu-latest
33+
needs: [SanitizeBranchName]
34+
steps:
35+
- name: Checkout code
36+
uses: actions/checkout@v4
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
repository: stackitcloud/rag-core-library
40+
- name: Set Docker Image Name
41+
run: |
42+
echo "RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME=rag-core-lib-lint:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
43+
shell: bash
44+
45+
- name: Build lint image
46+
run: |
47+
docker build -t "$RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME" --build-arg TEST=0 -f Dockerfile .
48+
49+
- name: Generate lint report
50+
run: |
51+
docker run --rm "$RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME" make lint
52+
53+
BuildAndTestMatrix:
54+
runs-on: ubuntu-latest
55+
needs: [SanitizeBranchName]
56+
strategy:
57+
fail-fast: true
58+
matrix:
59+
service: [ "rag-core-lib", "rag-core-api", "admin-api-lib", "extractor-api-lib" ]
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
with:
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
repository: stackitcloud/rag-core-library
66+
67+
- name: Set Docker Image Name
68+
run: echo "TEST_IMAGE_NAME=${{ matrix.service }}-test:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
69+
shell: bash
70+
71+
- name: Build test image
72+
run: docker build -t "$TEST_IMAGE_NAME" --build-arg TEST=1 --build-arg DIRECTORY=${{ matrix.service }} -f Dockerfile .
73+
74+
- name: Run tests
75+
run: docker run --rm "$TEST_IMAGE_NAME" make test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode
2+
*notes.md

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@ lint:
55
cd rag-core-api;make lint
66
cd admin-api-lib;make lint
77
cd extractor-api-lib;make lint
8-
9-
test:
10-
cd rag-core-lib;make test
11-
cd rag-core-api;make test

0 commit comments

Comments
 (0)