|
9 | 9 | - master |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - CI: |
13 | | - runs-on: ubuntu-latest |
14 | | - steps: |
15 | | - - uses: actions/checkout@v4 |
16 | | - - uses: actions/setup-python@v5 |
17 | | - with: |
18 | | - python-version: 3.13 |
19 | | - - name: 'Install dependencies' |
20 | | - run: pip install -r ./requirements.txt |
21 | | - |
22 | | - - name: Setup AWS SAM |
23 | | - uses: aws-actions/setup-sam@819220f63fb333a9a394dd0a5cab2d8303fd17e2 |
24 | | - |
25 | | - - name: Validate template |
26 | | - run: sam validate --lint |
27 | | - |
28 | | - - name: Run sam build |
29 | | - run: sam build --parallel |
| 12 | + SAMLint: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - uses: actions/setup-python@v5 |
| 17 | + with: |
| 18 | + python-version: 3.13 |
| 19 | + - name: 'Install dependencies' |
| 20 | + run: | |
| 21 | + pip install -r ./requirements.txt |
| 22 | + pip install anybadge |
| 23 | + - name: Setup AWS SAM |
| 24 | + uses: aws-actions/setup-sam@819220f63fb333a9a394dd0a5cab2d8303fd17e2 |
| 25 | + - name: Validate template |
| 26 | + id: samlint |
| 27 | + run: sam validate --lint |
| 28 | + continue-on-error: true |
| 29 | + - name: Pass badge |
| 30 | + if: steps.samlint.outcome == 'success' |
| 31 | + run: | |
| 32 | + anybadge --label "SAM Lint" --value "Passing" --file samlint.svg Passing=green |
| 33 | + - name: Fail badge |
| 34 | + if: steps.samlint.outcome == 'failure' |
| 35 | + run: | |
| 36 | + anybadge --label "SAM Lint" --value "Failure" --file samlint.svg Failure=red |
| 37 | + - name: Run sam build |
| 38 | + id: sambuild |
| 39 | + run: sam build --parallel |
| 40 | + continue-on-error: true |
| 41 | + - name: Pass badge |
| 42 | + if: steps.sambuild.outcome == 'success' |
| 43 | + run: | |
| 44 | + anybadge --label "SAM Build" --value "Passing" --file sambuild.svg Passing=green |
| 45 | + - name: Fail badge |
| 46 | + if: steps.sambuild.outcome == 'failure' |
| 47 | + run: | |
| 48 | + anybadge --label "SAM Build" --value "Failure" --file sambuild.svg Failure=red |
| 49 | + - name: Verify Changed files |
| 50 | + uses: tj-actions/verify-changed-files@v20 |
| 51 | + id: verify-changed-files |
| 52 | + with: |
| 53 | + files: | |
| 54 | + samlint.svg |
| 55 | + sambuild.svg |
| 56 | + - name: 'Commit files' |
| 57 | + if: steps.verify-changed-files.outputs.files_changed == 'true' |
| 58 | + run: | |
| 59 | + git config --local user.email "github-actions[bot]@users.noreply.github.com" |
| 60 | + git config --local user.name "github-actions[bot]" |
| 61 | + git add samlint.svg sambuild.svg |
| 62 | + git commit -m "Updated CI badges" samlint.svg sambuild.svg |
| 63 | + - name: 'Push changes' |
| 64 | + if: steps.verify-changed-files.outputs.files_changed == 'true' |
| 65 | + uses: ad-m/github-push-action@master |
| 66 | + with: |
| 67 | + github_token: ${{ secrets.github_token }} |
| 68 | + branch: ${{ github.ref }} |
0 commit comments