From 3f2453383be081a6c3c69d2d788bace40e94453a Mon Sep 17 00:00:00 2001 From: Loki077 Date: Tue, 31 Dec 2024 10:29:51 +1100 Subject: [PATCH] Ci: carbonix_build.yml only process active AC. As the python script won't generate an output if the aircraft config status is deprecated. Adding cecking for final-output directory before AWS CLI installation and S3 upload to avoid unnecessary steps. --- .github/workflows/carbonix_build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/carbonix_build.yml b/.github/workflows/carbonix_build.yml index 587ab973ff..3e2f12ef01 100644 --- a/.github/workflows/carbonix_build.yml +++ b/.github/workflows/carbonix_build.yml @@ -319,10 +319,19 @@ jobs: shell: sh -e {0} - name: Run aircraft_config.py + id: aircraft_config run: | python Tools/Carbonix_scripts/aircraft_config.py "libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/aircraft_configuration/${{ matrix.xml_file }}.xml" "${{ env.commit_id }}" + if [ -d "final-output" ]; then + echo "exists=true" >> $GITHUB_ENV + echo "Found final-output directory" + else + echo "exists=false" >> $GITHUB_ENV + echo "No final-output directory found" + fi - name: Install AWS CLI + if: ${{ env.exists == 'true' }} run: | apt-get update -y DEBIAN_FRONTEND=noninteractive apt-get install -y curl unzip @@ -331,6 +340,7 @@ jobs: ./aws/install --update - name: Configure AWS credentials + if: ${{ env.exists == 'true' }} uses: aws-actions/configure-aws-credentials@v4 with: aws-access-key-id: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} @@ -338,6 +348,7 @@ jobs: aws-region: us-east-1 - name: Upload to S3 + if: ${{ env.exists == 'true' }} run: | PATH_TO_S3=${{ needs.setup-s3-path.outputs.s3_path }} echo "Uploading Artifacts to: $PATH_TO_S3"