Skip to content

sync: agent/API transport and apply engine #175

sync: agent/API transport and apply engine

sync: agent/API transport and apply engine #175

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Same-repo PRs: post coverage comment from this job.
# Fork PRs: GITHUB_TOKEN is read-only; coverage-comment.yml (workflow_run)
# can post with a base-repo token after downloading the artifact.
permissions:
contents: read
pull-requests: write
issues: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: extractions/setup-just@v3
- name: Unit tests
run: just test
- name: Smoke API (mock hypervisor)
run: just smoke-api
- name: Coverage
run: just coverage
# Compact PR comment: one-line summary + full table under <details>.
- name: Coverage PR comment
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_SHA: ${{ github.sha }}
COVERAGE_XML: coverage.xml
MIN_COVERAGE: "75"
run: |
chmod +x scripts/coverage-pr-comment.sh
scripts/coverage-pr-comment.sh
- name: Prepare coverage artifact
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
run: |
set -euo pipefail
echo -n "${{ github.event.pull_request.number }}" > pr-number.txt
test -s pr-number.txt
test -f coverage.xml
- name: Upload coverage report
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
coverage.xml
pr-number.txt
retention-days: 5
if-no-files-found: error
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.12.2