forked from
tangled.org/core
Monorepo for Tangled — https://tangled.org
1# spindle pipeline manifest
2
3Spindle pipelines are defined under the `.tangled/workflows` directory in a
4repo. Generally:
5
6* Pipelines are defined in YAML.
7* Workflows can run using different *engines*.
8
9The most barebones workflow looks like this:
10
11```yaml
12when:
13 - event: ["push"]
14 branch: ["main"]
15
16engine: "nixery"
17
18# optional
19clone:
20 skip: false
21 depth: 50
22 submodules: true
23```
24
25The `when` and `engine` fields are required, while every other aspect
26of how the definition is parsed is up to the engine. Currently, a spindle
27provides at least one of these built-in engines:
28
29## `nixery`
30
31The Nixery engine uses an instance of [Nixery](https://nixery.dev) to run
32steps that use dependencies from [Nixpkgs](https://github.com/NixOS/nixpkgs).
33
34Here's an example that uses all fields:
35
36```yaml
37# build_and_test.yaml
38when:
39 - event: ["push", "pull_request"]
40 branch: ["main", "develop"]
41 - event: ["manual"]
42
43dependencies:
44 ## from nixpkgs
45 nixpkgs:
46 - nodejs
47 ## custom registry
48 git+https://tangled.sh/@oppi.li/statix:
49 - statix
50
51steps:
52 - name: "Install dependencies"
53 command: "npm install"
54 environment:
55 NODE_ENV: "development"
56 CI: "true"
57
58 - name: "Run linter"
59 command: "npm run lint"
60
61 - name: "Run tests"
62 command: "npm test"
63 environment:
64 NODE_ENV: "test"
65 JEST_WORKERS: "2"
66
67 - name: "Build application"
68 command: "npm run build"
69 environment:
70 NODE_ENV: "production"
71
72environment:
73 BUILD_NUMBER: "123"
74 GIT_BRANCH: "main"
75
76## current repository is cloned and checked out at the target ref
77## by default.
78clone:
79 skip: false
80 depth: 50
81 submodules: true
82```
83
84## git push options
85
86These are push options that can be used with the `--push-option (-o)` flag of git push:
87
88- `verbose-ci`, `ci-verbose`: enables diagnostics reporting for the CI pipeline, allowing you to see any issues when you push.
89- `skip-ci`, `ci-skip`: skips triggering the CI pipeline.