Skip to content

feat: Add Xen support #248

feat: Add Xen support

feat: Add Xen support #248

Workflow file for this run

name: check/static
on:
push:
branches: [stable]
pull_request:
types: [opened, synchronize, reopened]
branches: [staging]
paths:
- '**'
- '!.github/**'
- '.github/workflows/gochecks.yaml'
jobs:
go:
runs-on: ubuntu-latest
env:
RUNGOGENERATE: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: 1.22.3
cache: false
- name: Set Go variables
id: goenv
run: |
{
echo "cache=$(go env GOCACHE)"
echo "modcache=$(go env GOMODCACHE)"
echo "mod=$(go env GOMOD)"
} >>"$GITHUB_OUTPUT"
- name: Go caches
uses: actions/cache@v4
with:
path: |
${{ steps.goenv.outputs.cache }}
${{ steps.goenv.outputs.modcache }}
key: ${{ github.job }}-${{ runner.os }}-go-${{ hashFiles(steps.goenv.outputs.mod) }}
restore-keys: |
${{ github.job }}-${{ runner.os }}-go-
- name: Check that go.mod is tidy
uses: protocol/[email protected]
with:
run: |
git config --global --add safe.directory '*'
go mod tidy
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
echo "go.sum was added by go mod tidy"
exit 1
fi
git diff --exit-code -- go.sum go.mod
- name: gofumpt
if: success() || failure() # run this step even if the previous one failed
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
args: --timeout=30m --no-config --disable-all --enable=gofumpt --out-format=colored-line-number --build-tags "containers_image_storage_stub,containers_image_openpgp"
skip-cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.2
args: --timeout=30m --out-format=colored-line-number --build-tags "containers_image_storage_stub,containers_image_openpgp"
skip-cache: true
- name: go generate
uses: protocol/[email protected]
if: (success() || failure()) && env.RUNGOGENERATE == 'true'
with:
run: |
git clean -fd # make sure there aren't untracked files / directories
go generate ./...
# check if go generate modified or added any files
if ! $(git add . && git diff-index HEAD --exit-code --quiet); then
echo "go generate caused changes to the repository:"
git status --short
exit 1
fi