Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwhitaker committed Jul 30, 2024
1 parent 1fb30d3 commit bd06275
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"yaml.schemas": {
"./schema/runny.schema.json": ["fixtures/*.yaml", ".runny.yaml"]
"./schema/runny.schema.json": [
".runny.yaml",
"examples/*.yaml",
"fixtures/*.yaml"
]
}
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ Then run commands with runny:
```command
runny pip-install ruff
```

## Examples

Have a look in the [examples folder](./examples/) for examples of how you might use Runny with various languages and frameworks.
3 changes: 3 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Runny Examples

These files are named after a language or technology, but bear in mind that your Runny config should always be called `.runny.yaml`.
17 changes: 17 additions & 0 deletions examples/docker-compose.runny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
commands:
# Top tip: Docker Compose has good command-line completion already. But using runny, you can add entries for just the
# commands you use regularly, then get an uncluttered list of options when you tab-complete.
up:
run: docker compose up -d
down:
run: docker compose down
build-and-up:
run: docker compose up --build -d
logs:
argnames:
- service
run: docker compose logs $service
shell:
argnames:
- service
run: docker compose exec $service sh
23 changes: 23 additions & 0 deletions examples/go.runny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
commands:
clean:
run: |
go clean ./...
rm -rf dist
install-goreleaser:
if: "! command -v goreleaser"
run: brew install goreleaser/tap/goreleaser
release:
needs:
- clean
- install-goreleaser
run: |
export GITHUB_TOKEN=$(gh auth token)
goreleaser
generate-schema:
run: go generate ./...
test:
run: go test ./...
test-coverage:
run: go test -coverprofile=c.out ./... && go tool cover -func="c.out"
test-coverage-html:
run: go test -coverprofile=c.out ./... && go tool cover -html="c.out"
20 changes: 20 additions & 0 deletions examples/python-uv.runny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
commands:
install-uv:
if: "! command -v uv"
run: pip install uv
pip-sync:
needs:
- install-uv
run: uv pip sync requirements.txt
pip-compile-and-sync:
needs:
- install-uv
run: |
uv pip compile requirements.in -o requirements.txt
uv pip sync requirements.txt
pip-install:
argnames:
- packagespec
run: echo $packagespec >> requirements.in
then:
- pip-compile-and-sync
9 changes: 9 additions & 0 deletions examples/python.runny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
commands:
update-requirements:
run: pip freeze > requirements.txt
pip-install:
argnames:
- packagespec
run: pip install $packagespec
then:
- update-requirements

0 comments on commit bd06275

Please sign in to comment.