Skip to content

ci: rename lint and test workflow and add submodule update job #10

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

Merged
merged 16 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
23b61f0
chore: rename lint and test workflow and add submodule update job
a-klos Jan 31, 2025
5be859b
chore: add logging for sanitized branch name in lint-and-test workflow
a-klos Feb 4, 2025
671123a
chore: fix typo in lint-and-test workflow for sanitized branch name
a-klos Feb 4, 2025
03f3769
chore: enable submodules in lint-and-test workflow and remove debug l…
a-klos Feb 4, 2025
4d01305
chore: add submodule commit check in lint-and-test workflow
a-klos Feb 4, 2025
e306794
chore: update submodules to latest main
github-actions[bot] Feb 4, 2025
17df913
chore: update submodule checkout to use the current commit SHA
a-klos Feb 4, 2025
e8d98d7
Merge branch 'chore/add-update-submodule2test-action' of github.com:s…
a-klos Feb 4, 2025
f564d09
chore: update submodule commits for rag-core-library and rag-infrastr…
a-klos Feb 4, 2025
bd8f9a3
chore: update submodules to latest main
github-actions[bot] Feb 4, 2025
474813a
chore: rename BuildAndLint job to build-and-lint in lint-and-test wor…
a-klos Feb 4, 2025
4c2995a
Merge branch 'chore/add-update-submodule2test-action' of github.com:s…
a-klos Feb 4, 2025
1d50403
chore: update checkout ref in lint-and-test workflow and update submo…
a-klos Feb 4, 2025
89d751d
chore: update submodules to latest main
github-actions[bot] Feb 4, 2025
3051317
chore: clean up lint-and-test workflow by removing unused submodule c…
a-klos Feb 4, 2025
a726021
Merge branch 'chore/add-update-submodule2test-action' of github.com:s…
a-klos Feb 4, 2025
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
46 changes: 37 additions & 9 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint and test workflow
name: lint-and-test

on:
pull_request:
Expand All @@ -7,12 +7,12 @@ on:
workflow_dispatch:

jobs:
SanitizeBranchName:
sanitize-branch-name:
runs-on: ubuntu-latest
outputs:
sanitized_ref: ${{ steps.sanitize.outputs.sanitized_ref }}
steps:
- name: Sanitize Branch Name
- name: sanitize-branch-name
id: sanitize
run: |
SANITIZED_REF=$(echo "${GITHUB_HEAD_REF}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-')
Expand All @@ -27,10 +27,38 @@ jobs:
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}

BuildAndLint:
update-submodules:
name: update-submodules
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
submodules: false

- name: update-submodules
id: update-submodules
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule sync --recursive
git submodule update --init --remote --recursive

if [ -n "$(git status --porcelain)" ]; then
echo "Submodules have new commits. Committing and pushing..."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "chore: update submodules to latest main"
git push
else
echo "No submodule changes."
fi

build-and-lint:
name: Build and Lint
runs-on: ubuntu-latest
needs: [SanitizeBranchName]
needs: [sanitize-branch-name, update-submodules]
strategy:
fail-fast: true
matrix:
Expand All @@ -39,12 +67,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: stackitcloud/rag-template
submodules: 'true'
ref: ${{ github.event.pull_request.head.ref }}
submodules: true

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

- name: Build lint image
Expand Down
2 changes: 1 addition & 1 deletion rag-core-library
2 changes: 1 addition & 1 deletion rag-infrastructure
Loading