|
| 1 | +name: Update Vector Stores |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every Sunday at midnight UTC (0 0 * * 0) |
| 6 | + - cron: "0 0 * * 0" |
| 7 | + |
| 8 | +jobs: |
| 9 | + update-vector-stores: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + # Lists of directories to exclude for each repository |
| 13 | + # Add comma-separated directory names to exclude them from indexing |
| 14 | + # Example: EXCLUDE_AQA_TESTS: 'node_modules,dist,build' |
| 15 | + env: |
| 16 | + EXCLUDE_AQA_TESTS: "" |
| 17 | + EXCLUDE_TKG: "" |
| 18 | + EXCLUDE_AQA_SYSTEMTEST: "" |
| 19 | + EXCLUDE_AQA_TEST_TOOLS: "VitAI/RAG/VectorStore" |
| 20 | + EXCLUDE_STF: "" |
| 21 | + EXCLUDE_BUMBLEBENCH: "" |
| 22 | + EXCLUDE_RUN_AQA: "" |
| 23 | + EXCLUDE_OPENJ9_SYSTEMTEST: "" |
| 24 | + EXCLUDE_OPENJ9: "" |
| 25 | + EXCLUDE_OMR: "" |
| 26 | + EXCLUDE_OPENJ9_OPENJDK_JDK: "src/hostpot" |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Checkout repository |
| 30 | + uses: actions/checkout@v4 |
| 31 | + |
| 32 | + - name: Set up Python |
| 33 | + uses: actions/setup-python@v5 |
| 34 | + with: |
| 35 | + python-version: "3.x" |
| 36 | + cache: "pip" |
| 37 | + cache-dependency-path: "VitAI/RAG/requirements.txt" |
| 38 | + |
| 39 | + - name: Install dependencies |
| 40 | + run: | |
| 41 | + cd VitAI/RAG |
| 42 | + pip install -r requirements.txt |
| 43 | +
|
| 44 | + - name: Create .env file |
| 45 | + run: | |
| 46 | + cd VitAI/RAG |
| 47 | + echo "GITHUB_TOKEN=${{ secrets.MODELS_TOKEN }}" > .env |
| 48 | +
|
| 49 | + - name: Update adoptium/aqa-tests |
| 50 | + run: | |
| 51 | + cd VitAI/RAG |
| 52 | + if [ -n "${{ env.EXCLUDE_AQA_TESTS }}" ]; then |
| 53 | + python main.py --repo adoptium/aqa-tests --exclude "${{ env.EXCLUDE_AQA_TESTS }}" |
| 54 | + else |
| 55 | + python main.py --repo adoptium/aqa-tests |
| 56 | + fi |
| 57 | +
|
| 58 | + - name: Update adoptium/TKG |
| 59 | + run: | |
| 60 | + cd VitAI/RAG |
| 61 | + if [ -n "${{ env.EXCLUDE_TKG }}" ]; then |
| 62 | + python main.py --repo adoptium/TKG --exclude "${{ env.EXCLUDE_TKG }}" |
| 63 | + else |
| 64 | + python main.py --repo adoptium/TKG |
| 65 | + fi |
| 66 | +
|
| 67 | + - name: Update adoptium/aqa-systemtest |
| 68 | + run: | |
| 69 | + cd VitAI/RAG |
| 70 | + if [ -n "${{ env.EXCLUDE_AQA_SYSTEMTEST }}" ]; then |
| 71 | + python main.py --repo adoptium/aqa-systemtest --exclude "${{ env.EXCLUDE_AQA_SYSTEMTEST }}" |
| 72 | + else |
| 73 | + python main.py --repo adoptium/aqa-systemtest |
| 74 | + fi |
| 75 | +
|
| 76 | + - name: Update adoptium/aqa-test-tools |
| 77 | + run: | |
| 78 | + cd VitAI/RAG |
| 79 | + if [ -n "${{ env.EXCLUDE_AQA_TEST_TOOLS }}" ]; then |
| 80 | + python main.py --repo adoptium/aqa-test-tools --exclude "${{ env.EXCLUDE_AQA_TEST_TOOLS }}" |
| 81 | + else |
| 82 | + python main.py --repo adoptium/aqa-test-tools |
| 83 | + fi |
| 84 | +
|
| 85 | + - name: Update adoptium/STF |
| 86 | + run: | |
| 87 | + cd VitAI/RAG |
| 88 | + if [ -n "${{ env.EXCLUDE_STF }}" ]; then |
| 89 | + python main.py --repo adoptium/STF --exclude "${{ env.EXCLUDE_STF }}" |
| 90 | + else |
| 91 | + python main.py --repo adoptium/STF |
| 92 | + fi |
| 93 | +
|
| 94 | + - name: Update adoptium/bumblebench |
| 95 | + run: | |
| 96 | + cd VitAI/RAG |
| 97 | + if [ -n "${{ env.EXCLUDE_BUMBLEBENCH }}" ]; then |
| 98 | + python main.py --repo adoptium/bumblebench --exclude "${{ env.EXCLUDE_BUMBLEBENCH }}" |
| 99 | + else |
| 100 | + python main.py --repo adoptium/bumblebench |
| 101 | + fi |
| 102 | +
|
| 103 | + - name: Update adoptium/run-aqa |
| 104 | + run: | |
| 105 | + cd VitAI/RAG |
| 106 | + if [ -n "${{ env.EXCLUDE_RUN_AQA }}" ]; then |
| 107 | + python main.py --repo adoptium/run-aqa --exclude "${{ env.EXCLUDE_RUN_AQA }}" |
| 108 | + else |
| 109 | + python main.py --repo adoptium/run-aqa |
| 110 | + fi |
| 111 | +
|
| 112 | + - name: Update adoptium/openj9-systemtest |
| 113 | + run: | |
| 114 | + cd VitAI/RAG |
| 115 | + if [ -n "${{ env.EXCLUDE_OPENJ9_SYSTEMTEST }}" ]; then |
| 116 | + python main.py --repo adoptium/openj9-systemtest --exclude "${{ env.EXCLUDE_OPENJ9_SYSTEMTEST }}" |
| 117 | + else |
| 118 | + python main.py --repo adoptium/openj9-systemtest |
| 119 | + fi |
| 120 | +
|
| 121 | + - name: Update eclipse-openj9/openj9 |
| 122 | + run: | |
| 123 | + cd VitAI/RAG |
| 124 | + if [ -n "${{ env.EXCLUDE_OPENJ9 }}" ]; then |
| 125 | + python main.py --repo eclipse-openj9/openj9 --exclude "${{ env.EXCLUDE_OPENJ9 }}" |
| 126 | + else |
| 127 | + python main.py --repo eclipse-openj9/openj9 |
| 128 | + fi |
| 129 | +
|
| 130 | + - name: Update eclipse-omr/omr |
| 131 | + run: | |
| 132 | + cd VitAI/RAG |
| 133 | + if [ -n "${{ env.EXCLUDE_OMR }}" ]; then |
| 134 | + python main.py --repo eclipse-omr/omr --exclude "${{ env.EXCLUDE_OMR }}" |
| 135 | + else |
| 136 | + python main.py --repo eclipse-omr/omr |
| 137 | + fi |
| 138 | +
|
| 139 | + - name: Update ibmruntimes/openj9-openjdk-jdk |
| 140 | + run: | |
| 141 | + cd VitAI/RAG |
| 142 | + if [ -n "${{ env.EXCLUDE_OPENJ9_OPENJDK_JDK }}" ]; then |
| 143 | + python main.py --repo ibmruntimes/openj9-openjdk-jdk --exclude "${{ env.EXCLUDE_OPENJ9_OPENJDK_JDK }}" |
| 144 | + else |
| 145 | + python main.py --repo ibmruntimes/openj9-openjdk-jdk |
| 146 | + fi |
| 147 | +
|
| 148 | + - name: Check for changes |
| 149 | + id: check_changes |
| 150 | + run: | |
| 151 | + git config --global user.name 'github-actions[bot]' |
| 152 | + git config --global user.email 'github-actions[bot]@users.noreply.github.com' |
| 153 | +
|
| 154 | + # Check if there are any changes to commit |
| 155 | + if git diff --quiet && git diff --staged --quiet; then |
| 156 | + echo "has_changes=false" >> $GITHUB_OUTPUT |
| 157 | + echo "No changes detected in vector stores" |
| 158 | + else |
| 159 | + echo "has_changes=true" >> $GITHUB_OUTPUT |
| 160 | + echo "Changes detected in vector stores" |
| 161 | + fi |
| 162 | +
|
| 163 | + - name: Commit and push changes |
| 164 | + if: steps.check_changes.outputs.has_changes == 'true' |
| 165 | + run: | |
| 166 | + git add VitAI/RAG/VectorStore/ |
| 167 | + git add VitAI/RAG/.checkpoints/ |
| 168 | + git commit -m "chore: update vector stores (automated weekly update)" |
| 169 | + git push |
| 170 | +
|
| 171 | + - name: Summary |
| 172 | + run: | |
| 173 | + if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then |
| 174 | + echo "✅ Vector stores updated and committed successfully" |
| 175 | + else |
| 176 | + echo "ℹ️ No updates needed - vector stores are up to date" |
| 177 | + fi |
0 commit comments