Reduce CI jobs being run when not needed

This commit is contained in:
Gabe Kangas
2024-07-11 11:44:23 -07:00
parent e7d90d441e
commit c4756a9a45
4 changed files with 56 additions and 4 deletions

View File

@@ -18,14 +18,25 @@ jobs:
with:
concurrent_skipping: 'same_content_newer'
- name: Get changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v44
with:
files_yaml: |
src:
- '**/*.{go,mod,sum}'
- uses: earthly/actions-setup@v1
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
with:
version: 'latest' # or pin to an specific version, e.g. "v0.6.10"
- name: Earthly version
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: earthly --version
- name: Set up QEMU
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
id: qemu
uses: docker/setup-qemu-action@v3
with:
@@ -33,8 +44,10 @@ jobs:
platforms: all
- uses: actions/checkout@v4
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
- name: Run API tests
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10