Skip to content

Commit

Permalink
Ci: carbonix_build.yml only process active AC.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
loki077 committed Dec 30, 2024
1 parent c845db8 commit 6a99f2e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/carbonix_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -331,13 +340,15 @@ 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 }}
aws-secret-access-key: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
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"
Expand Down

0 comments on commit 6a99f2e

Please sign in to comment.