name: Automated API tests on: push: paths-ignore: - 'web/**' pull_request: paths-ignore: - 'web/**' jobs: test: runs-on: ubuntu-latest steps: - id: skip_check uses: fkirc/skip-duplicate-actions@v5 with: concurrent_skipping: 'same_content_newer' - name: Check out pull request code uses: actions/checkout@v4 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' - name: Get changed files id: changed-files-yaml uses: tj-actions/changed-files@v45 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: image: tonistiigi/binfmt:latest platforms: all - name: Run API tests if: steps.changed-files-yaml.outputs.src_any_changed == 'true' uses: nick-fields/retry@v3 with: timeout_minutes: 10 max_attempts: 3 command: earthly +api-tests