65
65
66
66
test :
67
67
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]
71
70
strategy :
72
71
fail-fast : false
73
72
matrix :
96
95
cd ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }}
97
96
git clone https://github.com/SorellaLabs/brontes.git
98
97
cd brontes
98
+ git checkout ${{ steps.branch-names.outputs.current_branch }}
99
99
./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-test-${{ matrix.features }} test ${{ matrix.features }}
100
100
'"
101
101
- name : Cleanup
@@ -104,7 +104,7 @@ jobs:
104
104
ssh brontes_server -tt "bash --login -c '
105
105
set -x
106
106
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 }}
108
108
'"
109
109
110
110
- name : Check test result
@@ -143,6 +143,7 @@ jobs:
143
143
cd ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }}
144
144
git clone https://github.com/SorellaLabs/brontes.git
145
145
cd brontes
146
+ git checkout ${{ steps.branch-names.outputs.current_branch }}
146
147
./scripts/run-tests.sh ${{ steps.branch-names.outputs.current_branch }} ${{ steps.branch-names.outputs.current_branch }}-it-${{ matrix.features }} it ${{ matrix.features }}
147
148
'"
148
149
@@ -152,9 +153,32 @@ jobs:
152
153
ssh brontes_server -tt "bash --login -c '
153
154
set -x
154
155
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 }}
156
157
'"
157
158
158
159
- name : Check integration test result
159
160
if : steps.run_it_tests.outcome == 'failure'
160
161
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