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