2021-09-17 14:04:09 -07:00
|
|
|
name: Automated API tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
2022-09-04 16:41:02 -07:00
|
|
|
- 'web/**'
|
2022-10-12 15:34:35 -07:00
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
2022-10-12 16:52:05 -07:00
|
|
|
- 'web/**'
|
2022-10-12 15:34:35 -07:00
|
|
|
|
2021-09-17 14:04:09 -07:00
|
|
|
jobs:
|
2022-09-04 16:41:02 -07:00
|
|
|
test:
|
2021-09-17 14:04:09 -07:00
|
|
|
runs-on: ubuntu-latest
|
2022-11-04 20:04:13 -07:00
|
|
|
|
2021-09-17 14:04:09 -07:00
|
|
|
steps:
|
2022-11-23 15:06:51 -08:00
|
|
|
- id: skip_check
|
|
|
|
uses: fkirc/skip-duplicate-actions@v5
|
|
|
|
with:
|
|
|
|
concurrent_skipping: 'same_content_newer'
|
|
|
|
|
2024-07-11 11:47:33 -07:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
2024-07-11 11:44:23 -07:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files-yaml
|
|
|
|
uses: tj-actions/changed-files@v44
|
|
|
|
with:
|
|
|
|
files_yaml: |
|
|
|
|
src:
|
|
|
|
- '**/*.{go,mod,sum}'
|
|
|
|
|
2022-09-04 16:41:02 -07:00
|
|
|
- uses: earthly/actions-setup@v1
|
2024-07-11 11:44:23 -07:00
|
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
2021-10-11 14:56:00 -07:00
|
|
|
with:
|
2022-09-04 16:41:02 -07:00
|
|
|
version: 'latest' # or pin to an specific version, e.g. "v0.6.10"
|
|
|
|
|
|
|
|
- name: Earthly version
|
2024-07-11 11:44:23 -07:00
|
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
2022-09-04 16:41:02 -07:00
|
|
|
run: earthly --version
|
2021-09-17 14:04:09 -07:00
|
|
|
|
2022-09-04 16:41:02 -07:00
|
|
|
- name: Set up QEMU
|
2024-07-11 11:44:23 -07:00
|
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
2022-09-04 16:41:02 -07:00
|
|
|
id: qemu
|
2023-10-07 14:56:58 -07:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-09-04 16:41:02 -07:00
|
|
|
with:
|
|
|
|
image: tonistiigi/binfmt:latest
|
|
|
|
platforms: all
|
|
|
|
|
|
|
|
- name: Run API tests
|
2024-07-11 11:44:23 -07:00
|
|
|
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
|
2024-04-09 18:23:40 -07:00
|
|
|
uses: nick-fields/retry@v3
|
2022-11-22 12:56:03 -08:00
|
|
|
with:
|
|
|
|
timeout_minutes: 10
|
|
|
|
max_attempts: 3
|
|
|
|
command: earthly +api-tests
|