Commit eb9eb1f6f041548fe670c76f7a90d1c53c75d620

Anthony Green 2022-09-07T07:49:51

Fix random build dir

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index bc4d48e..d89dafa 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -147,15 +147,14 @@ jobs:
           chmod go-rw /tmp/cfk
 
       - name: Generate build dir name
-        id: build-dir
         run: |
-          echo '::set-output name=BUILD_DIR::t/$GITHUB_RUN_NUMBER-$RANDOM'
+          echo BUILD_DIR=t/$GITHUB_RUN_NUMBER-$RANDOM >> $GITHUB_ENV
 
       - name: Check for host availability
         id: check-host
         run: |
           set +e
-          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "mkdir -p ${{ steps.build-dir.outputs.BUILD_DIR }}"
+          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "mkdir -p ${{ env.BUILD_DIR }}"
           if test $? -ne 0; then
             echo "Remote host is unavailable."
             echo '::set-output name=HOST_OK::NO'
@@ -173,24 +172,24 @@ jobs:
         if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
         run: |
           echo ${{ steps.check-host.outputs.HOST_OK }}
-          scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} -r * ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ steps.build-dir.outputs.BUILD_DIR }}
+          scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} -r * ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }}
 
       - name: Run configure and make
         if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
         run: |
-          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ steps.build-dir.outputs.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; CC=${{ matrix.CFARM_CC }} CXX=${{ matrix.CFARM_CXX }} ./configure --host=${{ matrix.CFARM_TRIPLE }}) || true; exit 0"
-          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ steps.build-dir.outputs.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make;) || true; exit 0"
+          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; CC=${{ matrix.CFARM_CC }} CXX=${{ matrix.CFARM_CXX }} ./configure --host=${{ matrix.CFARM_TRIPLE }}) || true; exit 0"
+          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make;) || true; exit 0"
 
       - name: Run tests
         if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
         run: |
-          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ steps.build-dir.outputs.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make check & CHECKPID=\$!; while kill -0 \$CHECKPID 2>/dev/null; do echo 'Waiting for tests to finish'; sleep 5; done;)"
+          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make check & CHECKPID=\$!; while kill -0 \$CHECKPID 2>/dev/null; do echo 'Waiting for tests to finish'; sleep 5; done;)"
 
       - name: Copy results and clean up
         if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}
         run: |
-          scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ steps.build-dir.outputs.BUILD_DIR }}/*/testsuite/*.log .
-          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "rm -rf ${{ steps.build-dir.outputs.BUILD_DIR }}"
+          scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }}/*/testsuite/*.log .
+          ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "rm -rf ${{ env.BUILD_DIR }}"
 
       - name: Install rlgl and run
         if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }}