Skip to content

Commit a261d9d

Browse files
0xvanbeethovenjnoorchashm37
andauthoredAug 13, 2024
Ludwig/ci utils (SorellaLabs#779)
* test * wip * updated cex-dex quotes filtering * Clippy * test * test * testing for final run * need more ram ffs * test * test * test * test * test * test kek * pushing for run * test * test * moved test db to brontes-ci folder to mitigate permission problem * Updated cli docs & fixing CI * test * testing perms issue * test cleanup for branch name with / --------- Co-authored-by: jnoorchashm37 <[email protected]>
1 parent 6637ccf commit a261d9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+571
-276
lines changed
 

‎.github/workflows/bench.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,23 @@ jobs:
3737
echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config
3838
3939
- name: cargo bench
40-
run: ssh brontes_server -tt "bash --login -c 'source ~/.bashrc && mkdir -p ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} && cd ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} && git clone https://github.com/SorellaLabs/brontes.git && cd brontes && git pull && git checkout ${{ steps.branch-names.outputs.current_branch }} && ./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} bench ${{ matrix.features }} '"
40+
run: |
41+
ssh brontes_server -tt "bash --login -c '
42+
source ~/.bashrc
43+
mkdir -p ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }}
44+
cd ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }}
45+
git clone https://github.com/SorellaLabs/brontes.git
46+
cd brontes
47+
git pull
48+
git checkout ${{ steps.branch-names.outputs.current_branch }}
49+
./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }} bench ${{ matrix.features }}
50+
'"
4151
4252
- name: Cleanup on cancellation
4353
if: cancelled()
4454
run: |
4555
ssh brontes_server -tt "bash --login -c 'source ~/.bashrc
4656
set -x
4757
rm -rf /home/brontes-ci/${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }}
48-
rm -rf /home/data/brontes-ci/${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }}
58+
rm -rf /home/brontes-ci/data/${{ steps.branch-names.outputs.current_branch }}-bench-${{ matrix.features }}
4959
'"

‎.github/workflows/ci.yml

+29-5
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ jobs:
6565

6666
test:
6767
runs-on: ubuntu-latest
68-
if: always()
69-
#&& !cancelled() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false
70-
#needs: [clippy, build]
68+
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && github.event.pull_request.draft == false
69+
needs: [clippy, build]
7170
strategy:
7271
fail-fast: false
7372
matrix:
@@ -96,6 +95,7 @@ jobs:
9695
cd ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }}
9796
git clone https://github.com/SorellaLabs/brontes.git
9897
cd brontes
98+
git checkout ${{ steps.branch-names.outputs.current_branch }}
9999
./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }} test ${{ matrix.features }}
100100
'"
101101
- name: Cleanup
@@ -104,7 +104,7 @@ jobs:
104104
ssh brontes_server -tt "bash --login -c '
105105
set -x
106106
rm -rf \$HOME/${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }}
107-
rm -rf /home/data/brontes-ci/${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }}
107+
rm -rf /home/brontes-ci/data/${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }}
108108
'"
109109
110110
- name: Check test result
@@ -143,6 +143,7 @@ jobs:
143143
cd ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }}
144144
git clone https://github.com/SorellaLabs/brontes.git
145145
cd brontes
146+
git checkout ${{ steps.branch-names.outputs.current_branch }}
146147
./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }} it ${{ matrix.features }}
147148
'"
148149
@@ -152,9 +153,32 @@ jobs:
152153
ssh brontes_server -tt "bash --login -c '
153154
set -x
154155
rm -rf \$HOME/${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }}
155-
rm -rf /home/data/brontes-ci/${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }}
156+
rm -rf /home/brontes-ci/data/${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }}
156157
'"
157158
158159
- name: Check integration test result
159160
if: steps.run_it_tests.outcome == 'failure'
160161
run: exit 1
162+
163+
cleanup:
164+
name: "Cleanup"
165+
needs: [test, it-test]
166+
if: always()
167+
runs-on: ubuntu-latest
168+
steps:
169+
- name: Init ssh config
170+
run: |
171+
mkdir ~/.ssh/
172+
echo "${{ secrets.BASTION_SSH }}" > ~/.ssh/bastion
173+
chmod 600 ~/.ssh/bastion
174+
echo "${{ secrets.BRONTES_SSH }}" > ~/.ssh/brontes_server
175+
chmod 600 ~/.ssh/brontes_server
176+
echo "${{ secrets.SSH_CONFIG }}" > ~/.ssh/config
177+
178+
- name: Run cleanup
179+
run: |
180+
ssh brontes_server -tt "bash --login -c '
181+
set -x
182+
rm -rf \$HOME/*/
183+
echo \"Cleanup completed\"
184+
'"

0 commit comments

Comments
 (0)
Please sign in to comment.