diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f3db9fcd..857e2173 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,6 +46,12 @@ jobs: language: ["cpp", "python"] steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + - name: Checkout repository uses: actions/checkout@v4 with: @@ -66,3 +72,9 @@ jobs: uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" + + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software diff --git a/.github/workflows/deploy_autonomy.yml b/.github/workflows/deploy_autonomy.yml index 3e430827..c2d98921 100644 --- a/.github/workflows/deploy_autonomy.yml +++ b/.github/workflows/deploy_autonomy.yml @@ -32,6 +32,12 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + - name: Checkout repository uses: actions/checkout@v4 with: @@ -68,13 +74,27 @@ jobs: name: Autonomy-${{ matrix.architecture }} path: /opt/Autonomy_Software/build/Autonomy_Software_${{ matrix.architecture }}.sh + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + create-release: runs-on: [self-hosted, linux, X64] needs: build-and-upload steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + - name: Checkout repository uses: actions/checkout@v4 + with: + submodules: recursive - name: Fix Dubious Ownership run: git config --global --add safe.directory /opt/Autonomy_Software @@ -105,3 +125,9 @@ jobs: files: "/opt/Autonomy_Software/artifacts/**" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software diff --git a/.github/workflows/deploy_docker.yml b/.github/workflows/deploy_docker.yml index 00e5c77d..2ed64c0a 100644 --- a/.github/workflows/deploy_docker.yml +++ b/.github/workflows/deploy_docker.yml @@ -102,6 +102,12 @@ jobs: quill-amd64: ${{ steps.changes.outputs.quill-amd64 }} steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -133,6 +139,12 @@ jobs: quill-amd64: - 'tools/package-builders/quill/quill-amd64-pkg.sh' + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + # This job is to rebuild the updated AMD64 packages and push them to the package repository. It is run on a # self-hosted runner because there is not an NVIDIA GPU available on the GitHub runners. It gets the list of # packages that need to be rebuilt from the previous job. It outputs a variable for each package that is set @@ -162,6 +174,12 @@ jobs: - quill steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -228,6 +246,12 @@ jobs: if: steps.rebuild_pkg.outputs.rebuilding_pkg == 'true' run: rm -rf /tmp/pkg/* + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + # This job is used to check if any of the packages for ARM64 need to be rebuilt. If any of the package build # scripts have been updated, then the packages need to be rebuilt in the next job. This job is run on a self- # hosted runner because there is not an NVIDIA GPU available on the GitHub runners. It outputs a variable for @@ -250,6 +274,12 @@ jobs: quill-arm64: ${{ steps.changes.outputs.quill-arm64 }} steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -281,6 +311,12 @@ jobs: quill-arm64: - 'tools/package-builders/quill/quill-arm64-pkg.sh' + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + # This job is to rebuild the updated ARM64 packages and push them to the package repository. It is run on a # self-hosted runner because there is not an NVIDIA GPU available on the GitHub runners. It gets the list of # packages that need to be rebuilt from the previous job. It outputs a variable for each package that is set @@ -309,6 +345,12 @@ jobs: - quill steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -375,6 +417,12 @@ jobs: if: steps.rebuild_pkg.outputs.rebuilding_pkg == 'true' run: rm -rf /tmp/pkg/* + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + # This job is used to build and push the new jammy docker image. It is run on a self-hosted runner because # there is not an NVIDIA GPU available on the GitHub runners. If this is being run on a pull request, then # the image is tagged with the date and time. If this is being run on a push, then the image is tagged with @@ -388,6 +436,12 @@ jobs: if: ${{ always() && !failure() && !cancelled() }} steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -461,6 +515,12 @@ jobs: cache-from: type=registry,ref=ghcr.io/missourimrdt/autonomy-jammy:buildcache cache-to: type=registry,ref=ghcr.io/missourimrdt/autonomy-jammy:buildcache,mode=max + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software + # This job is used to build and push the new jetpack docker image. It is run on a self-hosted runner because # there is not an NVIDIA GPU available on the GitHub runners. If this is being run on a pull request, then # the image is tagged with the date and time. If this is being run on a push, then the image is tagged with @@ -474,6 +534,12 @@ jobs: if: ${{ always() && !failure() && !cancelled() }} steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + # This step is used to checkout the repository. It is needed so that the package build scripts can be # checked for changes. - name: Checkout Repository @@ -546,3 +612,9 @@ jobs: push: true cache-from: type=registry,ref=ghcr.io/missourimrdt/autonomy-jetpack:buildcache cache-to: type=registry,ref=ghcr.io/missourimrdt/autonomy-jetpack:buildcache,mode=max + + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9fcf2e3..09007ccd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,6 +21,12 @@ jobs: runs-on: [self-hosted, linux, X64] steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + - name: Checkout repository uses: actions/checkout@v4 with: @@ -65,3 +71,9 @@ jobs: run: | cd /opt/Autonomy_Software/build if test -f "Autonomy_Software_${{ matrix.type }}Tests"; then ./Autonomy_Software_${{ matrix.type }}Tests ; else echo "No ${{ matrix.type }} Tests Exist" ; fi + + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 0866810a..c6a1a8c4 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -16,6 +16,12 @@ jobs: runs-on: [self-hosted, linux, X64] steps: + - name: Setup Action Environment + if: always() + run: | + cd /opt + if [ ! -d "Autonomy_Software" ]; then git clone --recurse-submodules -j8 https://github.com/MissouriMRDT/Autonomy_Software.git; fi + - name: Checkout repository uses: actions/checkout@v4 with: @@ -97,3 +103,9 @@ jobs: name: valgrind.rpt path: /opt/Autonomy_Software/tools/valgrind/valgrind.rpt retention-days: 1 + + - name: Cleanup Action Environment + if: always() + run: | + cd /opt + rm -rf /opt/Autonomy_Software