Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Azure build and test pipeline #2

Merged
merged 9 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions .azure/build-and-test.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Additional Guidelines:

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

Thank you for your contribution!
75 changes: 75 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Lint and test workflow

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
SanitizeBranchName:
runs-on: ubuntu-latest
outputs:
sanitized_ref: ${{ steps.sanitize.outputs.sanitized_ref }}
steps:
- name: Sanitize Branch Name
id: sanitize
run: |
SANITIZED_REF=$(echo "${GITHUB_HEAD_REF}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-')
SANITIZED_REF=${SANITIZED_REF#-}
SANITIZED_REF=${SANITIZED_REF%-}
SANITIZED_REF=${SANITIZED_REF:0:63}
if [[ -z "$SANITIZED_REF" || "$SANITIZED_REF" =~ ^-+$ ]]; then
SANITIZED_REF="tmp-branch"
fi
echo "::set-output name=sanitized_ref::${SANITIZED_REF}"
shell: bash
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}

BuildAndLint:
name: Build and Lint
runs-on: ubuntu-latest
needs: [SanitizeBranchName]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: stackitcloud/rag-core-library
- name: Set Docker Image Name
run: |
echo "RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME=rag-core-lib-lint:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
shell: bash

- name: Build lint image
run: |
docker build -t "$RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME" --build-arg TEST=0 -f Dockerfile .

- name: Generate lint report
run: |
docker run --rm "$RAG_CORE_LIBRARY_LINTING_DOCKER_IMAGE_NAME" make lint

BuildAndTestMatrix:
runs-on: ubuntu-latest
needs: [SanitizeBranchName]
strategy:
fail-fast: true
matrix:
service: [ "rag-core-lib", "rag-core-api", "admin-api-lib", "extractor-api-lib" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: stackitcloud/rag-core-library

- name: Set Docker Image Name
run: echo "TEST_IMAGE_NAME=${{ matrix.service }}-test:${{ needs.SanitizeBranchName.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
shell: bash

- name: Build test image
run: docker build -t "$TEST_IMAGE_NAME" --build-arg TEST=1 --build-arg DIRECTORY=${{ matrix.service }} -f Dockerfile .

- name: Run tests
run: docker run --rm "$TEST_IMAGE_NAME" make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.vscode
*notes.md
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ lint:
cd rag-core-api;make lint
cd admin-api-lib;make lint
cd extractor-api-lib;make lint

test:
cd rag-core-lib;make test
cd rag-core-api;make test
Loading