-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
87 lines (75 loc) · 2.41 KB
/
Copy pathjustfile
File metadata and controls
87 lines (75 loc) · 2.41 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
alias b := build
alias t := test
alias c := check
alias vc := version-check
alias vu := version-update
# List available tasks.
default:
@just --list
# Build the binary (also the local CLI).
[group('build')]
build:
shards install
shards build
# Remove build artifacts and dependencies.
[group('build')]
clean:
rm -rf bin/ lib/
# Run the tests.
[group('development')]
test:
crystal spec
# Format and lint without changing anything — what CI runs.
[group('development')]
check: version-check
crystal tool format --check
@just _ameba
# Auto-format and apply the lint fixes it can.
[group('development')]
fix:
crystal tool format
@just _ameba --fix
# Ameba ships as a shard, so build it once and reuse it.
_ameba *args:
#!/usr/bin/env bash
set -euo pipefail
if [ ! -x bin/ameba ]; then
mkdir -p bin
crystal build lib/ameba/bin/ameba.cr -o bin/ameba --release
fi
bin/ameba src spec scripts {{ args }}
# Re-record the renderer golden files, then read the diff before committing.
[group('development')]
golden:
UPDATE_GOLDEN=1 crystal spec
git diff --stat spec/fixtures/golden
# Regenerate the README gallery. Needs network — avatars come from github.com.
[group('documents')]
examples:
#!/usr/bin/env bash
set -euo pipefail
[ -x bin/contributor-mural ] || just build
bin/contributor-mural -c examples/showcase.yml
for config in examples/variants/*.yml; do
bin/contributor-mural -c "$config"
done
# Render a config the way the action would, without committing anything.
[group('documents')]
render config=".github/contributor-mural.yml" repo="crystal-actions/contributor-mural":
# Nothing can be pushed from here: GITHUB_ACTIONS is unset, which is what
# gates the commit, and INPUT_NO_COMMIT says so a second time.
docker run --rm \
-v "$PWD:/github/workspace" -w /github/workspace \
-e GITHUB_REPOSITORY={{ repo }} \
-e INPUT_CONFIG={{ config }} \
-e INPUT_NO_COMMIT=true \
-e INPUT_TOKEN="$(gh auth token)" \
ghcr.io/crystal-actions/contributor-mural:v1
# Report the version every file claims, and fail if they disagree.
[group('release')]
version-check:
@crystal run scripts/version_check.cr
# Set the version everywhere and open a changelog section; run before tagging.
[group('release')]
version-update version="":
@crystal run scripts/version_update.cr -- {{ version }}