-
Notifications
You must be signed in to change notification settings - Fork 48
122 lines (109 loc) · 3.08 KB
/
ci.installer.yml
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
on:
workflow_call:
pull_request:
paths:
- installer.sh
- .github/workflows/ci.installer.yml
concurrency:
group: ${{ github.ref || 'ci' }}/installer.sh
cancel-in-progress: true
permissions:
contents: read
jobs:
install-pkgx:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v4
# using cat | sh to emulate the curl command we tell people to use
- run: cat ./installer.sh | sh
- run: pkgx --version
usage-as-proxy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat ./installer.sh | sh -s node --eval 'console.log(1)'
- run: ./installer.sh sh -c "which pkgx"
- run: source <(cat ./installer.sh) duf
- run: if command -v pkgx; then exit 1; fi
sudo-not-required:
runs-on: ubuntu-latest
container: debian:buster-slim
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: curl
path: bin
- run: ./installer.sh
env:
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
sudo-required:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo chmod go-w /usr/local/bin
# ^^ we run as `runner` but this dir has 999 perms
- name: check
run: if touch /usr/local/bin/foo; then exit 1; fi
- run: ./installer.sh
- run: test "$(which pkgx)" = /usr/local/bin/pkgx
no-dirs:
strategy:
matrix:
dir: [/usr/local, /usr/local/bin]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo mv ${{ matrix.dir }} $(mktemp -d)
- run: ./installer.sh
- run: pkgx duf --version
multiple-apply-is-ok:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cat ./installer.sh | sh
- run: cat ./installer.sh | sh
linuxen:
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
container:
- debian:buster-slim
- debian:bullseye-slim
- debian:bookworm-slim
- archlinux:latest
- ubuntu:focal
- ubuntu:jammy
- ubuntu:24.04
- ubuntu:24.10
- fedora:latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
ref: curl
path: bin
- run: ./installer.sh
env:
PATH: ${{ github.workspace }}/bin:/usr/bin:/bin
- run: pkgx node --eval 'console.log(1)'
upgrades:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run:
curl https://dist.pkgx.dev/pkgx.sh/linux/x86-64/v1.0.0.tar.gz |
tar xz --strip-components=3
- run: mv pkgx /usr/local/bin
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
- run: PKGX_UPDATE=no ./installer.sh
- run: test "$(pkgx --version)" = 'pkgx 1.0.0'
- run: ./installer.sh
- run: pkgx semverator gt $(pkgx --version | awk '{print $2}') 1.0.0