Refac NASA service and test impl (graphite-agent) #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Code quality checks | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| - dev | |
| jobs: | |
| secrets-validation: | |
| runs-on: ubuntu-latest | |
| name: Validate repo secrets | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Validate the necessary secrets to run the workflow | |
| - name: Preflight Check for Secrets | |
| run: | | |
| echo "Validating GitHub Actions secrets in repo=${{ github.event.repository.name }}" | |
| MISSING_SECRETS=() | |
| # Explicitly check each secret | |
| if [[ -z "${{ secrets.AWS_ACCESS_KEY_ID }}" ]]; then | |
| echo "❌ AWS_ACCESS_KEY_ID is missing" | |
| MISSING_SECRETS+=("AWS_ACCESS_KEY_ID") | |
| else | |
| echo "✅ AWS_ACCESS_KEY_ID found" | |
| fi | |
| if [[ -z "${{ secrets.AWS_SECRET_ACCESS_KEY }}" ]]; then | |
| echo "❌ AWS_SECRET_ACCESS_KEY is missing" | |
| MISSING_SECRETS+=("AWS_SECRET_ACCESS_KEY") | |
| else | |
| echo "✅ AWS_SECRET_ACCESS_KEY found" | |
| fi | |
| if [[ -z "${{ secrets.AWS_REGION_NAME }}" ]]; then | |
| echo "❌ AWS_REGION_NAME is missing" | |
| MISSING_SECRETS+=("AWS_REGION_NAME") | |
| else | |
| echo "✅ AWS_REGION_NAME found" | |
| fi | |
| # Secret validation check | |
| if [ ${#MISSING_SECRETS[@]} -ne 0 ]; then | |
| echo "One or more required secrets are missing: ${MISSING_SECRETS[@]}. Please set them before running the workflow." | |
| exit 1 | |
| else | |
| echo "✅ All required secrets are set. Proceeding..." | |
| fi | |
| lint: | |
| name: Lint with Ruff | |
| runs-on: ubuntu-latest | |
| needs: secrets-validation | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Run linting with ruff | |
| run: uv tool run ruff check | |
| pre-commit: | |
| name: Run pre-commit hooks | |
| needs: secrets-validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install pre-commit | |
| run: | | |
| uv tool install pre-commit | |
| pre-commit install | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files |