Added AMI cleanup tool #8
This file contains 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: AMI cleanup tool CI | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
cancel-in-progress: true | |
group: "Only run one instance of AMI cleanup CI for PR #${{ github.event.number }}" | |
jobs: | |
check-if-should-run: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
should-verify-pr: ${{ steps.filter.outputs.changed }} # True if the AMI cleanup tool changed, false otherwise | |
steps: | |
- name: Filter out unrelated changes | |
uses: dorny/[email protected] | |
id: filter | |
with: | |
filters: | | |
changed: "tools/ami-cleanup/**" | |
verify-pr: | |
runs-on: ubuntu-latest | |
needs: | |
- check-if-should-run | |
if: ${{ needs.check-if-should-run.outputs.should-verify-pr }} | |
steps: | |
- name: Checkout repo | |
uses: actions/[email protected] | |
- name: Install Earthly | |
uses: earthly/[email protected] | |
with: | |
# renovate: earthly-version | |
version: v0.7.23 | |
- name: Lint Go code | |
working-directory: tools/ami-cleanup | |
run: earthly -ci +lint --OUTPUT_FORMAT=github-actions | |
- name: Run Go tests | |
working-directory: tools/ami-cleanup | |
run: earthly -ci +test --OUTPUT_FORMAT=github-actions |