29 LocalStack #42
Workflow file for this run
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: Continuous Integration | |
| on: | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| name: Build, Lint, and Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint code | |
| run: npm run lint | |
| - name: Check code formatting | |
| run: npm run format:check | |
| - name: Build application | |
| run: npm run build | |
| - name: Run tests with coverage | |
| run: npm run test:coverage | |
| # --- Infrastructure CDK Checks --- | |
| - name: Install infrastructure dependencies | |
| working-directory: ./infrastructure | |
| run: npm ci | |
| - name: Build infrastructure | |
| working-directory: ./infrastructure | |
| run: npm run build | |
| - name: Run infrastructure tests with coverage | |
| working-directory: ./infrastructure | |
| run: npm run test:coverage | |
| - name: Create infrastructure .env file | |
| working-directory: ./infrastructure | |
| run: | | |
| echo "${{ vars.CDK_ENV_DEV }}" > .env | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v5.1.1 | |
| with: | |
| role-to-assume: ${{ vars.AWS_ROLE_ARN_DEV }} | |
| role-session-name: ci-lambda-starter | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Synthesize CDK stacks | |
| working-directory: ./infrastructure | |
| run: npm run synth | |
| # Final Step: Clean up sensitive infrastructure files | |
| - name: Clean up sensitive files | |
| if: always() | |
| working-directory: ./infrastructure | |
| run: | | |
| echo "🧹 Cleaning up sensitive files..." | |
| rm -f .env | |
| rm -rf cdk.out | |
| echo "✅ Sensitive files cleaned up" |