Replace artifact upload with MinIO/S3 upload for test reports
All checks were successful
Code Quality & Security Scan / TFLint (push) Successful in 13s
Code Quality & Security Scan / Terraform Destroy (push) Has been skipped
Code Quality & Security Scan / Tfsec Security Scan (push) Successful in 27s
Code Quality & Security Scan / Checkov Security Scan (push) Successful in 18s
Code Quality & Security Scan / Terraform Tests (push) Successful in 1m4s
Code Quality & Security Scan / SonarQube Trigger (push) Successful in 29s
Code Quality & Security Scan / Terraform Init (push) Successful in 48s
Code Quality & Security Scan / Terraform Apply (push) Successful in 40s

- Replaced actions/upload-artifact with direct MinIO upload
- Uses same pattern as terraform plan upload
- Test reports stored in: terraform-tests/{repository}/{run_number}/
- Enhanced test report with repository, run number, and branch info
- Fixes: Gitea Actions artifact upload not supported

AWS CLI is installed and used to upload reports to S3-compatible MinIO
storage, matching the existing terraform plan upload workflow.
This commit is contained in:
Patrick de Ruiter 2025-11-09 10:09:57 +01:00
parent 58b600c1d2
commit 42245ff565
Signed by: pderuiter
GPG Key ID: 5EBA7F21CF583321

View File

@ -99,14 +99,30 @@ jobs:
echo "# Terraform Test Results" > test-report.md
echo "" >> test-report.md
echo "Test execution completed at $(date)" >> test-report.md
echo "" >> test-report.md
echo "Repository: ${{ github.repository }}" >> test-report.md
echo "Run Number: ${{ github.run_number }}" >> test-report.md
echo "Branch: ${{ github.ref }}" >> test-report.md
- name: Upload Test Report
- name: Upload Test Report to MinIO
if: always()
uses: actions/upload-artifact@v4
with:
name: terraform-test-report
path: test-report.md
retention-days: 30
env:
AWS_ACCESS_KEY_ID: ${{ secrets.MINIO_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MINIO_SECRET_KEY }}
MINIO_ENDPOINT: ${{ secrets.MINIO_ENDPOINT }}
MINIO_BUCKET: ${{ secrets.MINIO_BUCKET }}
run: |
# Install AWS CLI for S3-compatible operations
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install
# Upload test report to MinIO
TEST_PATH="terraform-tests/${{ github.repository }}/${{ github.run_number }}"
aws s3 cp test-report.md "s3://${MINIO_BUCKET}/${TEST_PATH}/test-report.md" \
--endpoint-url="${MINIO_ENDPOINT}"
echo "Test report uploaded to: s3://${MINIO_BUCKET}/${TEST_PATH}/"
sonarqube:
name: SonarQube Trigger