forked from railwayapp/railpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmise.toml
More file actions
91 lines (75 loc) · 2.6 KB
/
Copy pathmise.toml
File metadata and controls
91 lines (75 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[env]
BUILDKIT_HOST = "docker-container://buildkit"
_.path = './bin'
[tasks.setup]
run = [
"mise install",
"docker run --rm --privileged -d --name buildkit moby/buildkit || true",
"mise run tidy",
"cd docs/ && bun install",
]
[tasks.cli]
run = "go run cmd/cli/main.go"
[tasks.debug-cli]
run = "dlv debug github.com/railwayapp/railpack/cmd/cli --"
# build the CLI binary (`./bin/railpack`) for local use outside the project
[tasks.build]
run = "go build -o bin/railpack cmd/cli/main.go"
[tasks.clean]
run = [
"rm -rf bin dist docs/dist",
"docker exec buildkit buildctl prune",
"rm -f *.test",
# remove all images created by the integration test suite
"docker images 'railpack-test-*' -q | xargs -r docker rmi -f",
# remove images created by manually running `railpack build` against a project example
"find examples -name test.json -exec dirname {} \\; | xargs -n 1 basename | xargs -r -I {} docker rmi -f {}",
"go clean -testcache",
"mise cache clear",
"rm -rf /tmp/railpack",
]
# if a example folder does not have a test.json file, it will be skipped
[tasks.examples-without-tests]
run = "find examples -mindepth 1 -maxdepth 1 -type d ! -exec [ -f \"{}/test.json\" ] \\; -print "
# run unit tests
[tasks.test]
run = "go test -short ./..."
# Runs *all* integration tests. It is extremely slow, do not run this locally.
# Instead, only run the test that you are currently working on:
# `mise run test-integration -- -run "TestExamplesIntegration/config-file"`
[tasks.test-integration]
run = "go test -v ./integration_tests"
# run integration test for the example directory you're currently in
[tasks.test-integration-cwd]
run = """
if [[ ! "$MISE_ORIGINAL_CWD" =~ /examples/ ]]; then
echo "Error: must be run from within an examples/ directory"
exit 1
fi
example_name=$(basename "$MISE_ORIGINAL_CWD")
echo "Running integration test for: $example_name"
go test -v ./integration_tests -run "TestExamplesIntegration/$example_name"
"""
# update all test snapshots, if you've updated a example/ project, run this to update the snapshots
[tasks.test-update-snapshots]
env = { UPDATE_SNAPS = "true" }
run = "go test -short ./..."
# linting, formatting, and static analysis
[tasks.check]
run = ["go vet ./...", "go fmt ./...", "golangci-lint run"]
[tasks.tidy]
run = "go mod tidy"
[tasks.docs-build]
dir = "docs"
run = "bun run build"
[tasks.docs-dev]
dir = "docs"
run = "bun run dev"
[tools]
go = "1.23.4"
golangci-lint = "1.63.4"
bun = "1.3"
[settings]
experimental = true
# without this, navigating into various examples/ will output an annoying warning
idiomatic_version_file_enable_tools = ["python", "node", "ruby"]