diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index bfa5c73..d206a13 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -15,4 +15,6 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - - uses: j178/prek-action@af4d4fcb6922b8e6f65c0426947125fcc38794ce # v3.0.2 + - uses: jdx/mise-action@9b200bcecbfd6303e69a4a261b2e09e3757440a7 # v5 + + - run: prek run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 221e7d3..0000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,52 +0,0 @@ -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - args: ["--allow-multiple-documents"] - - id: check-added-large-files - - id: check-merge-conflict - - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.27.0 - hooks: - - id: commitlint - stages: [commit-msg] - language_version: lts - additional_dependencies: - - "@commitlint/config-conventional" - verbose: true - - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.11.0.1 - hooks: - - id: shellcheck - args: - [ - "-e", - "SC1091,SC1103,SC2148,SC2034,SC1090,SC1009,SC1054,SC1056,SC1072,SC1073,SC1083,SC2329", - ] - - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.12.0-2 - hooks: - - id: shfmt - args: ["-i", "4", "-ci", "-w"] - - repo: https://github.com/rhysd/actionlint - rev: v1.7.12 - hooks: - - id: actionlint - files: '^\.github/workflows/' - - repo: https://github.com/gitleaks/gitleaks - rev: v8.30.1 - hooks: - - id: gitleaks - - repo: https://github.com/commitizen-tools/commitizen - rev: v4.19.2 - hooks: - - id: commitizen - stages: [commit-msg] - - repo: https://github.com/golangci/golangci-lint - rev: v2.15.0 - hooks: - - id: golangci-lint - - id: golangci-lint-fmt diff --git a/Taskfile.yml b/Taskfile.yml deleted file mode 100644 index 05846e0..0000000 --- a/Taskfile.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: "3" - -tasks: - build:cli: - desc: Cross-compile the provider binaries into ./dist - cmds: - - goreleaser release --snapshot --clean - - build:provider:dev: - desc: Generate a provider.yaml pointing at local ./dist binaries - deps: ["build:cli"] - env: - PROJECT_ROOT: ./dist - cmd: go run ./hack/provider/main.go v0.0.0 > ./dist/provider.yaml - - build:provider:release: - desc: Generate a provider.yaml pointing at GitHub release assets - env: - GITHUB_OWNER: devsy-org - cmd: go run ./hack/provider/main.go {{ .VERSION }} > ./dist/provider.yaml - vars: - VERSION: - sh: git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0" - - test: - desc: Run unit tests - cmd: go test ./... - - test:e2e: - desc: Run no-machine e2e integration tests (macOS; no OrbStack required) - deps: ["build:cli"] - dir: e2e - cmd: go test -tags=e2e -v -ginkgo.v -timeout 3600s --ginkgo.label-filter=integration - - test:e2e:vm: - desc: Run full machine-lifecycle e2e tests (requires OrbStack) - deps: ["build:cli"] - dir: e2e - cmd: go test -tags=e2e -v -ginkgo.v -timeout 3600s --ginkgo.label-filter=vm - - lint: - desc: Run go vet - cmd: go vet ./... diff --git a/mise.lock b/mise.lock new file mode 100644 index 0000000..a4c410d --- /dev/null +++ b/mise.lock @@ -0,0 +1,67 @@ +# @generated - this file is auto-generated by `mise lock` https://mise.jdx.dev/dev-tools/mise-lock.html + +lockfile_version = 3 + +[[tools.go]] +version = "1.26.9" +backend = "core:go" +specifiers = ["1.26.9"] + +[tools.go."platforms.linux-x64"] +checksum = "sha256:42d158b4d8f7b61ac0a830567c940a86098fb7aac52e467a5ebec03ef5cc2f8d" +url = "https://dl.google.com/go/go1.26.9.linux-amd64.tar.gz" + +[tools.go."platforms.macos-arm64"] +checksum = "sha256:f9bb7c0a02506c5d9bf0d1eb1f7ee6c7684f844ae49558308a0427b830e022cc" +url = "https://dl.google.com/go/go1.26.9.darwin-arm64.tar.gz" + +[[tools.golangci-lint]] +version = "2.15.0" +backend = "aqua:golangci/golangci-lint" +specifiers = ["2.15.0"] + +[tools.golangci-lint."platforms.linux-x64"] +checksum = "sha256:9b7fe6a6bf6334b98decf8d86b11415ea7889afdabdd1959fdce23af2a9ebcea" +url = "https://github.com/golangci/golangci-lint/releases/download/v2.15.0/golangci-lint-2.15.0-linux-amd64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/647132535" +provenance = "github-attestations" + +[tools.golangci-lint."platforms.macos-arm64"] +checksum = "sha256:d1e409481a8ca846c4bc97e781eb5cb1bd5c23353a0b3977a1cbda1b1b6447d5" +url = "https://github.com/golangci/golangci-lint/releases/download/v2.15.0/golangci-lint-2.15.0-darwin-arm64.tar.gz" +url_api = "https://api.github.com/repos/golangci/golangci-lint/releases/assets/647132534" +provenance = "github-attestations" + +[[tools.goreleaser]] +version = "2.18.3" +backend = "aqua:goreleaser/goreleaser" +specifiers = ["2.18.3"] + +[tools.goreleaser."platforms.linux-x64"] +checksum = "sha256:b8dee4728bca1aba0d71a832a17cd0a3799f75372878e7ffa36aef2343bce0bc" +url = "https://github.com/goreleaser/goreleaser/releases/download/v2.18.3/goreleaser_Linux_x86_64.tar.gz" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/623773318" +provenance = "github-attestations" + +[tools.goreleaser."platforms.macos-arm64"] +checksum = "sha256:156f425536d40ce282b79c637ca00eb943792de6ad1e2482a4b21cc4b5421f4f" +url = "https://github.com/goreleaser/goreleaser/releases/download/v2.18.3/goreleaser_Darwin_all.tar.gz" +url_api = "https://api.github.com/repos/goreleaser/goreleaser/releases/assets/623773494" +provenance = "github-attestations" + +[[tools.prek]] +version = "0.5.5" +backend = "aqua:j178/prek" +specifiers = ["0.5.5"] + +[tools.prek."platforms.linux-x64"] +checksum = "sha256:5470e4aa0fc0ad9d3de7dfaf088fb746d59c2eda3b173c06418e7c8861a520eb" +url = "https://github.com/j178/prek/releases/download/v0.5.5/prek-x86_64-unknown-linux-gnu.tar.gz" +url_api = "https://api.github.com/repos/j178/prek/releases/assets/611684555" +provenance = "github-attestations" + +[tools.prek."platforms.macos-arm64"] +checksum = "sha256:e4bc3132023b50020e62b073bc3147082828bf250d8b9282850c6f2bed5471b6" +url = "https://github.com/j178/prek/releases/download/v0.5.5/prek-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/j178/prek/releases/assets/611684483" +provenance = "github-attestations" diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..aa4cf17 --- /dev/null +++ b/mise.toml @@ -0,0 +1,63 @@ +[settings] +experimental = true +lockfile = true +lockfile_platforms = ["linux-x64", "macos-arm64"] + +[tool_config] +locked = true + +[tools] +go = "1.26.9" +golangci-lint = "2.15.0" +goreleaser = "2.18.3" +prek = "0.5.5" + +[tasks.setup] +description = "Install dependencies and git hooks" +depends = ["setup:dependencies", "setup:hooks"] + +[tasks."setup:dependencies"] +description = "Download Go modules" +run = "go mod download" + +[tasks."setup:hooks"] +description = "Install prek git hooks" +run = "prek install" + +[tasks."build:cli"] +description = "Cross-compile the provider binaries into ./dist" +run = "goreleaser release --snapshot --clean" + +[tasks."build:provider:dev"] +description = "Generate a provider.yaml pointing at local ./dist binaries" +depends = ["build:cli"] +env = { PROJECT_ROOT = "./dist" } +run = "go run ./hack/provider/main.go v0.0.0 > ./dist/provider.yaml" + +[tasks."build:provider:release"] +description = "Generate a provider.yaml pointing at GitHub release assets" +env = { GITHUB_OWNER = "devsy-org" } +run = ''' +VERSION="$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")" +go run ./hack/provider/main.go "$VERSION" > ./dist/provider.yaml +''' + +[tasks.test] +description = "Run unit tests" +run = "go test ./..." + +[tasks."test:e2e"] +description = "Run no-machine e2e integration tests (macOS; no OrbStack required)" +depends = ["build:cli"] +dir = "e2e" +run = "go test -tags=e2e -v -ginkgo.v -timeout 3600s --ginkgo.label-filter=integration" + +[tasks."test:e2e:vm"] +description = "Run full machine-lifecycle e2e tests (requires OrbStack)" +depends = ["build:cli"] +dir = "e2e" +run = "go test -tags=e2e -v -ginkgo.v -timeout 3600s --ginkgo.label-filter=vm" + +[tasks.lint] +description = "Run go vet" +run = "go vet ./..." diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..a59109b --- /dev/null +++ b/prek.toml @@ -0,0 +1,83 @@ +#:schema https://www.schemastore.org/prek.json + +[[repos]] +repo = "https://github.com/pre-commit/pre-commit-hooks" +rev = "v6.0.0" + +[[repos.hooks]] +id = "trailing-whitespace" + +[[repos.hooks]] +id = "end-of-file-fixer" + +[[repos.hooks]] +id = "check-yaml" +args = ["--allow-multiple-documents"] + +[[repos.hooks]] +id = "check-added-large-files" + +[[repos.hooks]] +id = "check-merge-conflict" + +[[repos]] +repo = "https://github.com/alessandrojcm/commitlint-pre-commit-hook" +rev = "v9.27.0" + +[[repos.hooks]] +id = "commitlint" +stages = ["commit-msg"] +language_version = "lts" +additional_dependencies = ["@commitlint/config-conventional"] +verbose = true + +[[repos]] +repo = "https://github.com/shellcheck-py/shellcheck-py" +rev = "v0.11.0.1" + +[[repos.hooks]] +id = "shellcheck" +args = ["-e","SC1091,SC1103,SC2148,SC2034,SC1090,SC1009,SC1054,SC1056,SC1072,SC1073,SC1083,SC2329"] + +[[repos]] +repo = "https://github.com/scop/pre-commit-shfmt" +rev = "v3.12.0-2" + +[[repos.hooks]] +id = "shfmt" +args = ["-i","4","-ci","-w"] + +[[repos]] +repo = "https://github.com/rhysd/actionlint" +rev = "v1.7.12" + +[[repos.hooks]] +id = "actionlint" +files = "^\\.github/workflows/" + +[[repos]] +repo = "https://github.com/gitleaks/gitleaks" +rev = "v8.30.1" + +[[repos.hooks]] +id = "gitleaks" + +[[repos]] +repo = "https://github.com/commitizen-tools/commitizen" +rev = "v4.19.2" + +[[repos.hooks]] +id = "commitizen" +stages = ["commit-msg"] + +[[repos]] +repo = "https://github.com/golangci/golangci-lint" +rev = "v2.15.0" + +[[repos.hooks]] +id = "golangci-lint" +language_version = "1.26.9" + +[[repos.hooks]] +id = "golangci-lint-fmt" +language_version = "1.26.9"