forked from pkgxdev/pkgm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
133 lines (126 loc) · 4.75 KB
/
Taskfile.yml
File metadata and controls
133 lines (126 loc) · 4.75 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# https://taskfile.dev
version: '3'
tasks:
fmt:
cmds:
- deno fmt pkgm.ts
lint:
cmds:
- deno fmt --check pkgm.ts
- deno lint pkgm.ts
- deno check pkgm.ts
test:
cmds:
- ./pkgm.ts i git
- ~/.local/bin/git --version
- "! test -f /usr/local/bin/git"
- ./pkgm.ts ls | grep .local/pkgs/git-scm.org
- ./pkgm.ts rm git
- test ! -f ~/.local/bin/git
- ./pkgm.ts i pkgx.sh/brewkit
- ~/.local/bin/bk --help
# check repeats work
- rm ~/.local/bin/bk
- test ! -f /usr/local/bin/bk
- ./pkgm.ts i pkgx.sh/brewkit
- ~/.local/bin/bk --help
- ./pkgm.ts i gum
- ~/.local/bin/gum --version
# test a thing with deps
# https://github.com/pkgxdev/pkgm/issues/24
- ./pkgm.ts i curl
- ~/.local/bin/curl -L pkgx.sh
- ./pkgm.ts shim semverator
- ~/.local/bin/semverator validate 1.0.0
# tests shims do not shim deps
- ./pkgm.ts shim node@20
- test ! -d ~/.local/bin/openssl
- if [[ $(~/.local/bin/node --version) != v20* ]]; then false; fi
- ./pkgm.ts i hyperfine@1.18
- ./pkgm.ts outdated | grep hyperfine
- if pkgx semverator satisfies '>=1.19' "$(hyperfine --version | cut -f 2 -d ' ')"; then false; fi
- ./pkgm.ts update
- pkgx semverator satisfies '>=1.19' "$(hyperfine --version | cut -f 2 -d ' ')"
# verifies that libpkgx is creating the pantry at the right place
# Refs: https://github.com/pkgxdev/pkgm/issues/59
- |
export XDG_DATA_HOME=/tmp/foo
./pkgm.ts i semverator
if test -d /tmp/foo/pkgx; then
test $(uname) = Linux
else
test $(uname) = Darwin
fi
- |
set -x
export XDG_DATA_HOME=/tmp/bar
sudo ./pkgm.ts i node@22 dev
[[ $(node --version) = v22* ]] || exit 2
mkdir foo
cd foo
echo "dependencies: node@20" > pkgx.yaml
mkdir -p /tmp/bar/pkgx/dev$PWD/
touch /tmp/bar/pkgx/dev$PWD/dev.pkgx.activated # `dev .` doesn't work in CI (fix in dev^2)
[[ $(node --version) = v20* ]] || exit 3
# https://github.com/pkgxdev/pkgm/issues/62
- |
./pkgm.ts i spotify_player
spotify_player --version
test-pkgm-prefix:
env:
PKGM_PREFIX: /tmp/test_prefix
PATH:
sh: echo "/tmp/test_prefix/bin:$PATH"
cmds:
- ./pkgm.ts i git
- /tmp/test_prefix/bin/git --version
# - "! test -f /usr/local/bin/git"
# - "! test -f ~/.local/bin/git"
- ./pkgm.ts ls | grep /tmp/test_prefix/pkgs/git-scm.org
# verify ls doesn't show packages from other locations
- "./pkgm.ts ls | grep -v -E '^/tmp/test_prefix/pkgs/' && exit 1 || true"
- ./pkgm.ts rm git
- test ! -f /tmp/test_prefix/bin/git
# test with PKGM_PREFIX and shims
- ./pkgm.ts shim semverator
- /tmp/test_prefix/bin/semverator validate 1.0.0
# test update functionality with PKGM_PREFIX
- ./pkgm.ts i hyperfine@1.18
- ./pkgm.ts outdated | grep hyperfine
# verify outdated doesn't show packages from other locations
- "./pkgm.ts outdated | grep -E 'is outdated.*(/usr/local|\\.local)' && exit 1 || true"
- pkgx semverator satisfies '<1.19' "$(/tmp/test_prefix/bin/hyperfine --version | cut -f 2 -d ' ')"
- ./pkgm.ts update
- pkgx semverator satisfies '>=1.19' "$(/tmp/test_prefix/bin/hyperfine --version | cut -f 2 -d ' ')"
# verify update doesn't affect packages from other locations
- "test ! -f ~/.local/bin/hyperfine"
- echo "✅ Tests completed successfully"
upstream-init:
desc: Initialize upstream remote repository
cmds:
- git remote add upstream https://github.com/pkgxdev/pkgm.git
- echo "Upstream remote added successfully. You can verify with 'git remote -v'"
upstream-sync:
desc: Fetch and merge changes from upstream repository
cmds:
- git fetch upstream
- git merge upstream/main
- echo "Changes from upstream have been merged. Please review and commit if necessary."
upstream-rebase:
desc: Fetch and rebase changes from upstream repository
cmds:
- git fetch upstream
- git rebase upstream/main
- echo "Changes from upstream have been rebased. Please review and force push if necessary."
upstream-check:
desc: Check for differences between local and upstream repositories
cmds:
- git fetch upstream
- git log --oneline --left-right --graph --cherry-pick --boundary HEAD...upstream/main
upstream-status:
desc: Show the status of local branch compared to upstream
cmds:
- git fetch upstream
- git status
- echo "Local branch status compared to upstream:"
- git rev-list --left-right --count HEAD...upstream/main